[Help]Timer
#5

Quote:
Originally Posted by astanalol
Посмотреть сообщение
Happy New Year
Thank you, same for you.

I will try to help you. As I see, you have a command which creates the pickups, so we can destroy them after 45 seconds.

pawn Код:
// On top:

new Pickups[4]; // I just changed the variable names which we are going to use for now on.

CMD:robbery(playerid)
{
    Pickups[0] = CreatePickup(1274, 1,1966.6005,1021.6895,992.4688, 1);
    Pickups[1] = CreatePickup(1212, 1,1966.5988,1029.6251,992.4745,1);
    Pickups[2] = CreatePickup(1212, 1,1966.5957,1013.9757,992.4688,1);
    Pickups[3] = CreatePickup(1274, 1,1966.5984,1006.2905,992.4745, 1);
    return 1;
}  

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Pickups[0] || pickupid == Pickups[1] || pickupid == Pickups[2] || pickupid == Pickups[3])
    {
    GivePlayerMoney(playerid, 1000);
    DestroyPickup(pickupid);
    SetTimer("DestroyPickups, 40000, false);
    }  
    return 1;
}

forward DestroyPickups();

public DestroyPickups()
{
    for(new i; i <= 4; i++)
    {
    DestroyPickup(Pickups[i]);
    }
    return 1;
}
Reply


Messages In This Thread
[Help]Timer - by astanalol - 30.12.2014, 19:18
Re: [Help]Timer - by astanalol - 30.12.2014, 20:26
Re: [Help]Timer - by astanalol - 30.12.2014, 21:29
Re: [Help]Timer - by Cameltoe - 30.12.2014, 21:54
Re: [Help]Timer - by Boot - 30.12.2014, 21:57

Forum Jump:


Users browsing this thread: 1 Guest(s)