Raised This Month: $ Target: $400
 0% 

drop all weapons except for knife


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 12-06-2004 , 01:03   drop all weapons except for knife
Reply With Quote #1

i want to take all weapons of a client away,except for knife
i used this

Code:
client_cmd(id,"slot1;+attack;-attack;drop;slot2;+attack;-attack;drop;slot5;+attack;-attack;drop");

but it does no effects on BOTS?

any idea?
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-06-2004 , 01:30  
Reply With Quote #2

You could try this one, a bit heftier, though:

Code:
new weapons[32], num; get_user_weapons(id,weapons,num); for(new i=0;i<num;i++) { new weaponname[32]; get_weaponname(weapons[i],weaponname,31); client_cmd(id,"drop %s",weaponname); }

I believe with bots you have to specify the name of the weapon after the drop command.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 12-06-2004 , 03:45  
Reply With Quote #3

i tried this,but...
it seems that your codes do no effects ,either
maybe "client_cmd" do no effects to BOTS?
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 12-06-2004 , 05:18  
Reply With Quote #4

you can use "strip_user_weapons" and "give_item"

that way the players get all their guns removed and get a knife
without you needing to do any client commands which won't work

it would look like this:

Code:
new plist_public[32],pnum_public get_players(plist_public, pnum_public) for(new i=0; i<pnum_public; i++){         if(is_user_connected(plist_public[i]) == 1 && is_user_alive(plist_public[i]) == 1){                 strip_user_weapons(plist_public[i])                 new weapknife[24]                 new knifename[32] = "knife"                 format(weapknife,23,"weapon_%s",knifename)                 give_item(plist_public[i],weapknife)         } }
FeuerSturm is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-06-2004 , 20:12  
Reply With Quote #5

You may have to use engclient_cmd for bots.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 12-07-2004 , 03:58  
Reply With Quote #6

yes,i tried engclient_cmd
it still didn't work for me
instead of this i use strip_user_weapons...
now it works well...
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 12-07-2004 , 05:01  
Reply With Quote #7

oh, yeah, you're welcome, no need for a "thank you",
next time i won't even bother to help. SMD
FeuerSturm is offline
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 12-07-2004 , 10:19  
Reply With Quote #8

don't be angry with me,plz....FireStorm
i just want to tell u it didn't work for me
thank u very much for your help~~
and sorry much for my bad manner...
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
Votorx
Senior Member
Join Date: Jun 2004
Old 12-07-2004 , 13:23  
Reply With Quote #9

Probably doesn't work on bots because they aren't considered clients. Nor do they even resemble a client seeing as they are called directly from the engine (I think?). You'd think that eng_cmd would do it but I guess it doesn't.

What you can try doing is just completely stripp the user of their weapons (strip_use_weapons()), then use give_item() and give them their knife. Should work on bots too.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
breaddawson
Senior Member
Join Date: Jul 2004
Location: Beijing,China
Old 12-09-2004 , 22:29  
Reply With Quote #10

yes,the stri_user_weapons() works quite well
then how can we make other commands excuted by bots?
i mean,for example,i want a bot say:"i'm a bot!!"
how can i do that?
__________________
i'm bread dawson ,a chinese boy
wish u be happy~
breaddawson is offline
Send a message via ICQ to breaddawson Send a message via MSN to breaddawson
Reply



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


All times are GMT -4. The time now is 13:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode