Simple timer doesn't work..
#1

pawn Код:
new Float:RandomSpawn[][3] =
{
    {2327.1094,-1169.7896,28.0864},
    {2327.1094,-1169.7896,28.0864},
    {2327.1094,-1169.7896,28.0864}
};

forward StartFire();


SetTimer("StartFire",60000,1);


public StartFire()
{
    new
        rand = random(sizeof(RandomSpawn))
    ;
   
    CreateFire(RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
    SendClientMessageToAll(COLOR_WHITE, "A BIG FIRE HAS STARTED !");

    for(new x = 0; x < MAX_PLAYERS; x++)
    {
        if(IsPlayerConnected(x)) SetPlayerCheckpoint(x, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2], 3.0);
    }

    return 1;
}
Reply
#2

Add this under OngamemodeInit
pawn Код:
public OnGamemodeInit() {
SetTimer("StartFire",60000,1);

//rest of your code
Reply
#3

Quote:
Originally Posted by ToiletDuck
Посмотреть сообщение
Add this under OngamemodeInit
pawn Код:
public OnGamemodeInit() {
SetTimer("StartFire",60000,1);

//rest of your code
What do you mean.. ?I want that the timer will active the fire bro
Reply
#4

If you want to start creating fire in random coords.

Just Put this Under your OnGamemodeInit
pawn Код:
SetTimer("StartFire",60000,1); // PUT THIS UNDER YOUR ON GAMEMODEINIT every 1 min the StartFire function will call
Reply
#5

Quote:
Originally Posted by ToiletDuck
Посмотреть сообщение
If you want to start creating fire in random coords.

Just Put this Under your OnGamemodeInit
pawn Код:
SetTimer("StartFire",60000,1); // PUT THIS UNDER YOUR ON GAMEMODEINIT every 1 min the StartFire function will call
Thats what I did from the first try..
Reply
#6

Up.. Plz help ..
Reply
#7

pawn Код:
public StartFire()
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new rand = random(sizeof(RandomSpawn));
            CreateFire(RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2]);
            SendClientMessageToAll(COLOR_WHITE, "A BIG FIRE HAS STARTED !");
            SetPlayerCheckpoint(i, RandomSpawn[rand][0], RandomSpawn[rand][1], RandomSpawn[rand][2], 3.0);
        }
    } // not connected
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)