random spec?
#1

i already tried these both ways and i can't get a player spectate a random person after he dies by gravity. please help me .. :/

pawn Код:
if(killerid != INVALID_PLAYER_ID)
    {
        new count[MAX_PLAYERS];
        for (new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                count[i]++;
            }
        }
        SendDeathMessage(killerid, playerid, reason);
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, random(sizeof(count)));
    }
pawn Код:
if(killerid != INVALID_PLAYER_ID)
    {
        new count;
        for (new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                count++;
            }
        }
        SendDeathMessage(killerid, playerid, reason);
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, random(sizeof(count)));
    }
Reply
#2

i have the same problem :/
Reply
#3

bump
Reply
#4

pawn Код:
if(killerid != INVALID_PLAYER_ID)
{
    new Players[MAX_PLAYERS],count;
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && i != playerid)
        {
            Players[count] = i;
            count++;
        }
    }
    SendDeathMessage(killerid, playerid, reason);
    if(count)
    {
        TogglePlayerSpectating(playerid, 1);
        PlayerSpectatePlayer(playerid, Players[random(count)]);
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)