.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   Example on how to force a weapon drop (http://forums.bots-united.com/showthread.php?t=939)

Austin 29-02-2004 06:46

Example on how to force a weapon drop
 
Can someone show me how to
1) check to see if a person has an awp as their primary weapon
2) force them to drop it?

This would be in a mm plugin running cs 1.5
Thanks!

Pierre-Marie Baty 29-02-2004 21:52

Re: Example on how to force a weapon drop
 
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.

Austin 29-02-2004 22:11

Re: Example on how to force a weapon drop
 
Pm, Thanks again man! I owe you.
The check is in the mail..

Never mind PM, it was just a dumb joke.

Pierre-Marie Baty 02-03-2004 21:26

Re: Example on how to force a weapon drop
 
check in the mail ? what the hell are you talking about ? o_O


All times are GMT +2. The time now is 03:59.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.