foreach question
#1

Solved
Reply
#2

so any help?
Reply
#3

ItterRandom?
Reply
#4

Quote:
Originally Posted by Kitten
Посмотреть сообщение
is it possible to make this with foreach include

i set a timer

pawn Код:
SetTimer("NewSkin",60000,true);
ok but in NewSkin function

pawn Код:
public NewSkin(playerid)
{
     // how would i make it so like it only gets 1 players out of TEAM_SPETNAZ to TEAM_NAVYSEALS
     return 1;
}
so is it possible to do it with foreach
What do you mean with // how would i make it so like it only gets 1 players out of TEAM_SPETNAZ to TEAM_NAVYSEALS
Reply
#5

i tryed making it but my mind cant figure it out

pawn Код:
public NewSkin(playerid)
{
    new randomplayer = Iter_Random(Player);
    // What do u mean iter random? how could i make it;P
    return 1;
}
and i mean that so like for a example after the timer runs out it will make 1 player from the other team to others team
Reply
#6

pawn Код:
public NewSkin(playerid)
{
    new rand;
    do
    {
        rand = random(MAX_PLAYERS);
    }
    while(!IsPlayerConnected(rand));
    if(gTeam[rand] != TEAM_NAVYSEALS)
    {
        gTeam[rand] = TEAM_NAVYSEALS;
    }
    else
    {
        gTeam[rand] = TEAM_SPETNAZ;
    }
    return 1;
    /* Remember to change gTeam[]
    to your actual team variable */

}
It should work..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)