Raised This Month: $ Target: $400
 0% 

How do I do a command on all people?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zamma
Member
Join Date: May 2004
Old 10-26-2006 , 07:03   How do I do a command on all people?
Reply With Quote #1

Ive only just started amxx coding again and am a little rusty.

In a plugin I have a concmd which when Runs I want ALL players on ONE team to have their weapons removed.


How do I get it to effect all players?
Zamma is offline
Zamma
Member
Join Date: May 2004
Old 10-26-2006 , 07:12   Re: How do I do a command on all people?
Reply With Quote #2

help anyone?
Zamma is offline
Zamma
Member
Join Date: May 2004
Old 10-26-2006 , 07:15   Re: How do I do a command on all people?
Reply With Quote #3

Like - I need to filter through all the players - find which are marines - and then remove all weapons - then pick one by random and give him a weapon.
Zamma is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-26-2006 , 08:24   Re: How do I do a command on all people?
Reply With Quote #4

to effect all on server:
Code:
 strip_user_weapons(0) //drop all weapons to everyone  give_item(0, CSW_KNIFE) //give everyone a knife
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 10-26-2006 , 08:59   Re: How do I do a command on all people?
Reply With Quote #5

Or more team specific
Code:
for(new i=0;i<=get_maxplayers();i++) {     if(is_user_connected(i))     {         if(pev(i,pev_team) == 1)//The number was only as example as team 1             client_print(i,print_chat,"you are in team 1")         else             client_print(i,print_chat,"you are in team %d",pev(i,pev_team))     } } client_print(0,print_chat,"This is a message for all")
__________________

Last edited by schnitzelmaker; 10-26-2006 at 09:17.
schnitzelmaker is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-26-2006 , 09:19   Re: How do I do a command on all people?
Reply With Quote #6

Quote:
Originally Posted by Rolnaaba View Post
to effect all on server:
Code:
 strip_user_weapons(0) //drop all weapons to everyone  give_item(0, CSW_KNIFE) //give everyone a knife
You sir have a misunderstanding. While it is true a good bit of default natives allow you to pass zero to go through the whole server, you must remember that not all of them do. I say this to prevent 50 billion people coming back here and going "z 0 m g it does not work I R DON'T UNDERSTAND!"
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Zamma
Member
Join Date: May 2004
Old 10-26-2006 , 09:39   Re: How do I do a command on all people?
Reply With Quote #7

Thanks ALOT guys this has really helped

can someone please explain

"for(new i=0;i<=get_maxplayers();i++)"

please
Zamma is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-26-2006 , 09:41   Re: How do I do a command on all people?
Reply With Quote #8

Quote:
Originally Posted by Zenith77 View Post
You sir have a misunderstanding. While it is true a good bit of default natives allow you to pass zero to go through the whole server, you must remember that not all of them do. I say this to prevent 50 billion people coming back here and going "z 0 m g it does not work I R DON'T UNDERSTAND!"
my mistake I thought that strip_user_weapons and give_item were one of those that do allow it if I am wrong I apologize
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Zamma
Member
Join Date: May 2004
Old 10-26-2006 , 10:32   Re: How do I do a command on all people?
Reply With Quote #9

Now i need to set it so it randomly picks a player from team 1.

how cud i accomplish this?
Zamma is offline
Zamma
Member
Join Date: May 2004
Old 10-26-2006 , 10:40   Re: How do I do a command on all people?
Reply With Quote #10

I get an error saying my function should return a value

help anyone
Zamma is offline
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 16:28.


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