Raised This Month: $ Target: $400
 0% 

how can i change all other players team in that ^ code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
omer
Senior Member
Join Date: Nov 2011
Old 09-05-2012 , 04:08   how can i change all other players team in that ^ code?
Reply With Quote #1

Hello again,

Guys i am having an problem

PHP Code:
register_concmd"amx_chang""Cmd_AdminMode"ADMIN_BAN);

public 
Cmd_AdminMode(idlevelcid)
{
    
cs_set_user_teamidCS_TEAM_CT );

I can change the team of the player who writes the command amx_chang but how can i change all other players team in that ^ code?
__________________

omer is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-05-2012 , 04:21   Re: how can i change all other players team in that ^ code?
Reply With Quote #2

"get_players" and "for" functions

PHP Code:
new iPlayer[32]; 
__________________
simanovich is offline
omer
Senior Member
Join Date: Nov 2011
Old 09-05-2012 , 04:23   Re: how can i change all other players team in that ^ code?
Reply With Quote #3

Quote:
Originally Posted by simanovich View Post
"get_players" and "for" functions

PHP Code:
new iPlayer[32]; 
Can't understand
__________________

omer is offline
gogicaa
Veteran Member
Join Date: Aug 2011
Location: //
Old 09-05-2012 , 04:43   Re: how can i change all other players team in that ^ code?
Reply With Quote #4

Loop through players and then use cs_set_user_team.
gogicaa is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-05-2012 , 04:53   Re: how can i change all other players team in that ^ code?
Reply With Quote #5

PHP Code:
new iPlayers[32];
get_playersdont remember the f**** code :( );
 
for (new 
0dont remebmer... ; i++)
if (
cs_get_user_team(i) == CS_TEAM_T)
cs_set_user_team(i,CS_TEAM_CT);
else
cs_set_user_team(i,CS_TEAM_T); 
Please someone fix my code
__________________
simanovich is offline
omer
Senior Member
Join Date: Nov 2011
Old 09-05-2012 , 05:13   Re: how can i change all other players team in that ^ code?
Reply With Quote #6

I have tried this but didn't work:

PHP Code:
 new g_Max
    
    g_Max 
get_maxplayers()

    for( new 
<= g_Max i++ )
    {
       
cs_set_user_teamiCS_TEAM_T );
    } 
__________________

omer is offline
omer
Senior Member
Join Date: Nov 2011
Old 09-05-2012 , 05:45   Re: how can i change all other players team in that ^ code?
Reply With Quote #7

Quote:
Originally Posted by simanovich View Post
PHP Code:
new iPlayers[32];
get_playersdont remember the f**** code :( );
 
for (new 
0dont remebmer... ; i++)
if (
cs_get_user_team(i) == CS_TEAM_T)
cs_set_user_team(i,CS_TEAM_CT);
else
cs_set_user_team(i,CS_TEAM_T); 
Please someone fix my code
This?

PHP Code:
new iPlayers[32], inumpid 
get_players
(playersinum"ch")
 
for (new 
0;  inumi++)
if (
cs_get_user_team(i) == CS_TEAM_T)
cs_set_user_team(i,CS_TEAM_CT);
else
cs_set_user_team(i,CS_TEAM_T); 
__________________

omer is offline
omer
Senior Member
Join Date: Nov 2011
Old 09-05-2012 , 07:02   Re: how can i change all other players team in that ^ code?
Reply With Quote #8

Quote:
Originally Posted by omer View Post

PHP Code:
new iPlayers[32], inumpid 
get_players
(playersinum"ch")
 
for (new 
0;  inumi++)
if (
cs_get_user_team(i) == CS_TEAM_T)
cs_set_user_team(i,CS_TEAM_CT);
else
cs_set_user_team(i,CS_TEAM_T); 

When i try this there is errors please can anyone tell me the way!!!
__________________

omer is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 09-05-2012 , 07:04   Re: how can i change all other players team in that ^ code?
Reply With Quote #9

Quote:
Originally Posted by omer View Post
When i try this there is errors please can anyone tell me the way!!!
cuz this code isn't complite and need to be fixed
__________________
simanovich is offline
Old 09-05-2012, 07:12
omer
This message has been deleted by omer.
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 09-05-2012 , 08:41   Re: how can i change all other players team in that ^ code?
Reply With Quote #10

Code:
new iPlayers[32], inum, pid get_players(players, inum, "ch")   for (new i = 0;  i < inum; i++) {     pid = players[i]     switch (cs_get_user_team(pid)) {         case CS_TEAM_T: cs_set_user_team(pid, CS_TEAM_CT)         case CS_TEAM_CT: cs_set_user_team(pid, CS_TEAM_T)     } }

Last edited by jimaway; 09-05-2012 at 08:43.
jimaway is offline
Reply


Thread Tools
Display Modes

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 08:19.


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