Adding Commands (cvars) to a game

Discussions about ET modding (sdk code, player/weapon modeling)

Moderators: Forum moderators, developers

Post Reply
User avatar
dutchmeat
Posts: 62
Joined: Tue Jan 28, 2003 8:08 am
Location: Netherlands
Contact:

Adding Commands (cvars) to a game

Post by dutchmeat »

Hello Bani,
Can you help me with the Adding of commands?
I want a command that slows panzer down.
I already have the command but it doesn't have any effect so what do i have to add to this (g_missle) fire_rocket:

// JPW NERVE
if (g_gametype.integer != GT_SINGLE_PLAYER)
VectorScale(dir,100,bolt->s.pos.trDelta); //DM slow rocket
else
VectorScale(dir,2500,bolt->s.pos.trDelta);


Greetings DutchMeat
User avatar
fretn
Posts: 341
Joined: Sun Jul 27, 2003 4:35 am
Location: Belgium!

Post by fretn »

just take a look how other cvars are implemented in the source

example: perform a search on 'g_gravity' and check what stuff is added and where, then add your cvar the same way the g_gravity cvar works
Day by day : http://w.twwwo.be/
User avatar
dutchmeat
Posts: 62
Joined: Tue Jan 28, 2003 8:08 am
Location: Netherlands
Contact:

Post by dutchmeat »

It works! if (g_gametype.integer != GT_SINGLE_PLAYER)
VectorScale(dir,(trap_Cvar_VariableIntegerValue("g_slowpanzer")==1?100:2500),bolt->s.pos.trDelta); //DM slow rocket
else
VectorScale(dir,2500,bolt->s.pos.trDelta);

Thanks to wrath :)


But does anybody knows howto do MotD ? *Banners in BaniMod
i really want a MotD and /settings commands
Post Reply