Chose Team
#1

Hello i want to create randomid can been choosen
I want the random id can got just by TEAM_ZOMBIE
Randomid from TEAM_ZOMBIE not chose someone from TEAM_RED

Ok ? Understand
Thnx
Reply
#2

I don't really understand you, but use random to create a random chance of something.
Reply
#3

Yes I user ranodm but the random must choosen by TEAM_ZOMBIE
Reply
#4

AnyOne?
Reply
#5

Explain no one understand you !!!
Reply
#6

I want to choose somebody random by ZOMBIE TEAM

UNderstand now ?/


Thank you
Reply
#7

Create an array, put all player-id's which are in the zombie-team in this array and count them.
Then you can use "random" to select a random index from that array with "count" as your maximum value.

pawn Код:
new Players[MAX_PLAYERS], Count;

for (new pid; pid < MAX_PLAYERS; pid++)
{
    if (GetPlayerTeam(pid) == TEAM_ZOMBIE)
    {
        Players[Count] = pid;
        Count++;
    }
}

new RandomZombiePlayer = Players[random(Count)];
Something like this should work.
Reply
#8

I dont know his id's
I want
Its a Function StartMap
and in it i want to choose randomid by Team_Zombie
Reply
#9

PHP код:
        for(new 0MAX_PLAYERS i++)
        {
            if(
gTeam[i] == TEAM_ZOMBIE) {
            
//    script......
            
}
        } 
Reply
#10

I want to chose any player from team zombie
Not set the playerid
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)