please help with team auto select
#1

well my game mode is hide n kill so of course no one wants to be the killer so how can i make it so 1 person gets randomly selected to be the kiler
Reply
#2

Try this code, not sure if it works. You will have to edit it a bit...

pawn Код:
public StartGame()
{
    for(new x=0; x<MAX_PLAYERS; x++)
    {
        if(IsPlayerConnected(x))
        {
            new rand = random(2);
            if(rand == 1)
            {
                SetPVarInt(x, "IsKiller", 1);

                new str[85];
                format(str, sizeof(str), "%s has been randomly chosen as the killer!", pName(x));
                SendClientMessageToAll(0xFFFAFFF, str);
                break;
            }
            else continue;
        }
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)