Look at the spawn function in my info_frontline.
At the gamerules line, where it calls the gamerules function.

It could also be done like FLFGameRules()->SetRulesMode(m_iRulesType);

Or for you, SDKGameRules()->(your function here)

Just add something to your rules ;p


-----Original Message-----
From: r00t 3:16 [mailto:[EMAIL PROTECTED]
Sent: January 2, 2005 6:08 PM
To: [email protected]
Subject: Re: [hlcoders] PlayerSpawn

Ok I have an entity somewhat working for the gamerules.
I can assign the entity a value via hammer. For what the game mode will be.
I debugged the class

class TRGameRules : public CPointEntity
{
};

To make sure it was being assigned a value, which it is.
Now my question is how do I update, or how am I able to get this info in the
SDKGameRules?
This is where I am stuck.


r00t 3:16
CQC Gaming
www.cqc-gaming.com
----- Original Message -----
From: "Tony "omega" Sergi" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, January 01, 2005 9:58 PM
Subject: RE: [hlcoders] PlayerSpawn


> Uhh, you're creating CSDKGameRules as an entity?!
>
> Make a NEW entity, that UPDATES CSDKGameRules. Don't make CSDKGameRules an
> entity!!
>
> Ie:
>
> class CInfoFrontline : public CPointEntity
> {
> public:
> DECLARE_CLASS( CInfoFrontline, CPointEntity );
>
> DECLARE_DATADESC();
>
> void Spawn()
> {
> //omega;
> ((CFLFGameRules*)g_pGameRules)->SetRulesMode(m_iRulesType);
>
> SetMoveType( MOVETYPE_NONE );
> SetSolid( SOLID_NONE );
> // Remove model & collisions
> AddEffects( EF_NOSHADOW | EF_NORECEIVESHADOW | EF_NODRAW );
> };
> bool KeyValue( const char *szKeyName, const char *szValue )
> {
> if (FStrEq(szKeyName, "rulestype"))
> {
> m_iRulesType = atoi(szValue);
> }
> else if (FStrEq(szKeyName, "warmuptime"))
> {
> m_flWarmupTime = atof(szValue);
> }
> else if (FStrEq(szKeyName, "spawntime_att"))
> {
> m_flSpawnTime_Attackers = atof(szValue);
> }
> else if (FStrEq(szKeyName, "spawntime_def"))
> {
> m_flSpawnTime_Defenders = atof(szValue);
> }
> else
> return BaseClass::KeyValue( szKeyName, szValue );
>
> return true;
> };
>
> private:
> int m_iRulesType;
> float m_flWarmupTime;
> float m_flSpawnTime_Defenders;
> float m_flSpawnTime_Attackers;
> };
>
> BEGIN_DATADESC( CInfoFrontline )
>
> DEFINE_KEYFIELD( m_iRulesType, FIELD_INTEGER, "rulestype" ),
> DEFINE_KEYFIELD( m_flWarmupTime, FIELD_FLOAT, "warmuptime" ),
> DEFINE_KEYFIELD( m_flSpawnTime_Defenders, FIELD_FLOAT, "spawntime_def" ),
> DEFINE_KEYFIELD( m_flSpawnTime_Attackers, FIELD_FLOAT, "spawntime_att" ),
>
> END_DATADESC()
>
> LINK_ENTITY_TO_CLASS(info_frontline, CInfoFrontline);

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.7 - Release Date: 30/12/2004



_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to