.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
Example on how to force a weapon drop
Old
  (#1)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Example on how to force a weapon drop - 29-02-2004

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!
  
Reply With Quote
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 22:54..
  
Reply With Quote
Re: Example on how to force a weapon drop
Old
  (#3)
Austin
Moderator
 
Austin's Avatar
 
Status: Offline
Posts: 403
Join Date: Nov 2003
Default Re: Example on how to force a weapon drop - 29-02-2004

Pm, Thanks again man! I owe you.
The check is in the mail..

Never mind PM, it was just a dumb joke.

Last edited by Austin; 03-03-2004 at 02:47..
  
Reply With Quote
Re: Example on how to force a weapon drop
Old
  (#4)
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 - 02-03-2004

check in the mail ? what the hell are you talking about ? o_O



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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com