Pickups didn't destroy after time over.
#4

This does not belong under OnGameModeInit

Код:
SetTimer("Destroypickup", 20000, false);
From what you want to do, you can use that function (extended) at the same time you create the pickup, it'd be like this:

PHP код:
public OnPlayerDeath(playerid)
{
    
meatDrops[playerid] = CreatePickup(2804,19,Float:x,Float:y,Float:z,0);
    
SetTimerEx("Destroypickup"20000false,"i",playerid); //NOTICE the Ex, means Extended so we can pass the playerid value to the function
    
return 1;

And leave everything else as it is, it should work like that.

The reason for it to not work under OnGameModeInit is that it's only called once the gamemode inits (hence the name of the callback), it wont do anything else after that.

The reason for us to use SetTimerEx is to be able to pass the playerid value to the function Destroypickup, so it'd make sense.

EDIT: Ow, didn't notice the previous posts.
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: 2 Guest(s)