Pickups didn't destroy after time over.
#2

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.

PHP код:
meatDrops[playerid] = CreatePickup(2804,19,Float:x,Float:y,Float:z,0);
SetTimerEx("Destroypickup"20000false"i"playerid); 
PHP код:
forward Destroypickup(playerid);
public 
Destroypickup(playerid)
{
    
DestroyPickup(meatDrops[playerid]);
    
meatDrops[playerid] = -1;

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.
Reply


Messages In This Thread
Pickups didn't destroy after time over. - by Pokemon64 - 17.03.2017, 12:46
Re: Pickups didn't destroy after time over. - by Threshold - 17.03.2017, 12:58
Re: Pickups didn't destroy after time over. - by raydx - 17.03.2017, 12:59
Re: Pickups didn't destroy after time over. - by Toroi - 17.03.2017, 13:00
Re: Pickups didn't destroy after time over. - by Pokemon64 - 17.03.2017, 13:44

Forum Jump:


Users browsing this thread: 3 Guest(s)