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);
-----Original Message-----
From: r00t 3:16 [mailto:[EMAIL PROTECTED]
Sent: January 1, 2005 6:44 PM
To: [email protected]
Subject: Re: [hlcoders] PlayerSpawn
Basically what I have so far is
#ifndef CLIENT_DLL
LINK_ENTITY_TO_CLASS(info_player_ttf, CPointEntity);
LINK_ENTITY_TO_CLASS(info_player_terrorist, CPointEntity);
#endif
LINK_ENTITY_TO_CLASS(info_gamerules, CSDKGameRules);
Now I guess i need some kind of function to see what info_gamerules is set
to.
I can get the info with this I would imagine
gEntList.FindEntityByClassname(m_iGameRules, "info_gamerules");
Then decide what the game play is going to be and load the proper menu's
etc.
Which those above are not a problem.
How do I setup the FGD file so they can change this in hammer?
Is it PointClass? BaseClass?
I am gonna go read the sdk docs again also, I read them once and I did not
make much sense, but I am starting to get an understanding of how everything
works so maybe I will get it now.
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 6:02 PM
Subject: RE: [hlcoders] PlayerSpawn
> Yep. It's spawn function passes the variables to gamerules, and then sets
> itself intangible (but still triggerable, so you can use I/o with it).
>
>
> -----Original Message-----
> From: r00t 3:16 [mailto:[EMAIL PROTECTED]
> Sent: January 1, 2005 5:49 PM
> To: [email protected]
> Subject: Re: [hlcoders] PlayerSpawn
>
> When you created this entity you did something like
> LINK_ENTITY_TO_CLASS( "info_gamemode", CSDKGameRules);
>
> or something correct?
> Just want to make sure im headed in the correct direction :)
>
>
> r00t 3:16
> CQC Gaming
> www.cqc-gaming.com
>
> --
> 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
>
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.296 / Virus Database: 265.6.7 - Release Date: 30/12/2004
--
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