SetTimer With PickUp - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetTimer With PickUp (
/showthread.php?tid=466114)
SetTimer With PickUp -
BoU3A - 26.09.2013
how to use SetTimer With PickUp..?
Re: SetTimer With PickUp -
Voxel - 26.09.2013
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.
Re: SetTimer With PickUp -
Konstantinos - 26.09.2013
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.