17.03.2017, 12:58
First of all, why are you calling the timer in OnGameModeInit if it is meant to be executed 20 seconds after the player dies?
Secondly, timers with parameters should be called with SetTimerEx, not SetTimer.
https://sampwiki.blast.hk/wiki/SetTimerEx
EDIT: You also need to remember a player can die more than once in 20 seconds. So you could potentially end up with more than 1 pickup if you're not careful and it won't be removed.
Secondly, timers with parameters should be called with SetTimerEx, not SetTimer.
PHP код:
meatDrops[playerid] = CreatePickup(2804,19,Float:x,Float:y,Float:z,0);
SetTimerEx("Destroypickup", 20000, false, "i", playerid);
PHP код:
forward Destroypickup(playerid);
public Destroypickup(playerid)
{
DestroyPickup(meatDrops[playerid]);
meatDrops[playerid] = -1;
}
EDIT: You also need to remember a player can die more than once in 20 seconds. So you could potentially end up with more than 1 pickup if you're not careful and it won't be removed.