SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 29/05/2020, 10:59 AM   #1
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 233
Reputation: 4
Default count players

Hello, I have come up with an interesting minigame but I don't know how to match the number of players, if team 1 has 1 player, you enter Team 2 and when Team 2 has the same amount, the next player enters Team 1 and so on...

Thanks!
Ertouq is offline   Reply With Quote
Old 29/05/2020, 12:01 PM   #2
xRadical3
Gangsta
 
xRadical3's Avatar
 
Join Date: May 2017
Location: Iran
Posts: 559
Reputation: 20
Default Re: count players

See this example:
pawn Code:
new TDM_Count = 0; //on top of script

TDM_Count++; //Add 1 to the var
if(TDM_Count == 3) TDM_Count = 1; //If the var is 3, we set it to 1
SetPlayerTeam(playerid, TDM_Count); //finally, set the player team
// TDM_Count can only be 1 or 2
xRadical3 is online now   Reply With Quote
Old 29/05/2020, 01:21 PM   #3
Ertouq
Huge Clucker
 
Ertouq's Avatar
 
Join Date: Jul 2014
Posts: 233
Reputation: 4
Default Re: count players

Quote:
Originally Posted by xRadical3 View Post
See this example:
pawn Code:
new TDM_Count = 0; //on top of script

TDM_Count++; //Add 1 to the var
if(TDM_Count == 3) TDM_Count = 1; //If the var is 3, we set it to 1
SetPlayerTeam(playerid, TDM_Count); //finally, set the player team
// TDM_Count can only be 1 or 2
Thanks!
Ertouq is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Players count Fs Help!! vikoo Scripting Help 13 14/12/2016 04:03 PM
How to count players using a particular cmd? Nabster Scripting Help 2 19/02/2015 01:50 PM
Count players Kudoz Scripting Help 9 26/07/2013 03:31 AM
Count 1/2 players knackworst Scripting Help 7 18/09/2011 10:10 AM
[HELP] How to get players' count? RoCK'N'Rolla Help Archive 1 10/09/2010 09:42 AM


All times are GMT. The time now is 03:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.