ongamemodeinit explode 1 random player???
#1

how would i set a timer for 1 minute so after game mode starts it blows up 1 random person? also after all players on TEAM_HIDER 0 are gone (cause i have on player death setplayerteam to the other team) the game mode restarts and it says all players exterminated! restarting in 5 seconds. please help. Thanks
Reply
#2

Stop making 500 topics and post all your requests in 1?

and OnGameModeInit, then there are no players connected...
Reply
#3

Quote:
Originally Posted by [DRD]Rodney
Посмотреть сообщение
Stop making 500 topics and post all your requests in 1?

and OnGameModeInit, then there are no players connected...
He Said A Timer.

i could make one but it will be buggy<.<
Reply
#4

Bump
Reply
#5

pawn Код:
public OnGameModeInit()
{
    SetTimer("ExplodePlayer",60000,false);
    return 1;
}

public ExplodePlayer()
{
    new conn_ID[MAX_PLAYERS],count;
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        conn_ID[count] = i;
        count++;
    }
    if(count == 0) return 1; // No players were connected...
    new Float:x,Float:y,Float:z;
    GetPlayerPos(conn_ID[random(count)],x,y,z);
    CreateExplosion(x, y, z, 5, 20); // Player goes boom
    return 1;
}
Maybe you can learn from that

Finding a random player to work with in the entire server is messy though, I can't think of another way to do it without looping through to make sure they're connected and build an array with the information in it.
Reply
#6

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
pawn Код:
public OnGameModeInit()
{
    SetTimer("ExplodePlayer",60000,false);
    return 1;
}

public ExplodePlayer()
{
    new conn_ID[MAX_PLAYERS],count;
    for(new i; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        conn_ID[count] = i;
        count++;
    }
    if(count == 0) return 1; // No players were connected...
    new Float:x,Float:y,Float:z;
    GetPlayerPos(conn_ID[random(count)],x,y,z);
    CreateExplosion(x, y, z, 5, 20); // Player goes boom
    return 1;
}
Maybe you can learn from that

Finding a random player to work with in the entire server is messy though, I can't think of another way to do it without looping through to make sure they're connected and build an array with the information in it.
hmm you seem beast. thanks and if its not too much to ask no one has helped me with... how can i restart the game mode when all players on a team (TEAM_HIDER 0) like when theres no more players on that team when its empty because when they die they are switched to another team. so how can i do this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)