17.03.2017, 13:00
This does not belong under OnGameModeInit
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:
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.
Код:
SetTimer("Destroypickup", 20000, false);
PHP код:
public OnPlayerDeath(playerid)
{
meatDrops[playerid] = CreatePickup(2804,19,Float:x,Float:y,Float:z,0);
SetTimerEx("Destroypickup", 20000, false,"i",playerid); //NOTICE the Ex, means Extended so we can pass the playerid value to the function
return 1;
}
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.