View Single Post
Re: Example on how to force a weapon drop
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Example on how to force a weapon drop - 29-02-2004

1:
Code:
edict_t *pPlayer;
 
// does this player own an AWP rifle ?
if (pPlayer->v.weapons & (1 << CS_WEAPON_AWP))
; // yes, he does
2:
Code:
// using a server-sided client command, force pPlayer to
// select and drop his AWP
(*g_engfuncs.pfnClientCommand) (pPlayer, "weapon_awp");
(*g_engfuncs.pfnClientCommand) (pPlayer, "drop");
CS_WEAPON_AWP is not defined in the SDK, but look in one or the other CS bot's source code to know its value.

Also check to see whether you need a carriage return (\n) after the client command strings or not.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 29-02-2004 at 21:54..
  
Reply With Quote