SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 01/08/2010, 12:11 AM   #1
lSCARl
Big Clucker
 
Join Date: Jul 2010
Posts: 71
Reputation: 0
Default Help With putting random person on a certain team

my game mode is hide n kill and alot of times people dont like being on TEAM_HUNTER 1 so i have to make it select a random person but i dont know how please help.
lSCARl is offline  
Old 01/08/2010, 12:25 AM   #2
PotH3Ad
Huge Clucker
 
Join Date: Jul 2008
Location: Westside - CA
Posts: 285
Reputation: 5
Default Re: Help With putting random person on a certain team

Add this where you want to pick the random player...

pawn Code:
for(new x=0; x!=MAX_PLAYERS; x++)
{
    if(GetPlayerTeam(x) != TEAM_HUNTER)
    {
        new str[80];
        format(str, sizeof(str), "%s has been randomly set to \"Team Hunter\"", pName(x));
        SendClientMessageToAll(0xAAFFFFF, str);
        SetPlayerTeam(x, TEAM_HUNTER);
        break;
    }
}
PotH3Ad is offline  
Old 01/08/2010, 01:38 AM   #3
lSCARl
Big Clucker
 
Join Date: Jul 2010
Posts: 71
Reputation: 0
Default Re: Help With putting random person on a certain team

Quote:
Originally Posted by PotH3Ad View Post
Add this where you want to pick the random player...

pawn Code:
for(new x=0; x!=MAX_PLAYERS; x++)
{
    if(GetPlayerTeam(x) != TEAM_HUNTER)
    {
        new str[80];
        format(str, sizeof(str), "%s has been randomly set to \"Team Hunter\"", pName(x));
        SendClientMessageToAll(0xAAFFFFF, str);
        SetPlayerTeam(x, TEAM_HUNTER);
        break;
    }
}
this makes everyone who joins a hunter. how can i fix it
lSCARl is offline  
 

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
Random person? w00tNew Help Archive 4 03/06/2010 05:50 AM
Getting two random numbers and putting them together into a variable. Kenny990 Help Archive 4 09/07/2009 10:17 PM
Putting numbers in random order... Robbin237 Help Archive 0 31/03/2009 04:07 PM


All times are GMT. The time now is 11:44 AM.


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