SetTimer With PickUp
#1

how to use SetTimer With PickUp..?
Reply
#2

What exactly do you want? heres an example for an armour pick up. (from samp wiki)

pawn Код:
new armour; // Create a variable to store the pickup ID in

forward armour();

public OnGameModeInit()
{
    SetTimer("armour", 1000, false); // Set a timer of 1000 miliseconds (1 second)
    armour = CreatePickup(1242, 2, 1503.3359, 1432.3585, 10.1191, -1);// Create an armour pickup and store the ID in 'pickup'
    return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == armour)
    {
        SetPlayerArmour(playerid, 100);
        DestroyPickup(pickup);
        KillTimer(armour[playerid]);
    }
    return 1;
}
I dont know if it works but i tried ! i hope i put you in the right direction.
Reply
#3

It all depends on what you want to do. When a player pickups a pickup, the OnPlayerPickUpPickup callback is called. A timer seems to be useless.

Give more details please.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)