23.12.2010, 22:32
You need to use CreatePickup if you want to store the pickup-id.
AddStaticPickup only returns "1" if the pickup was succesfully created, it doesn't return an id.
Also, when you need the coordinates later ingame for some reason, you can store the coordinates too, along with the id.
AddStaticPickup only returns "1" if the pickup was succesfully created, it doesn't return an id.
Also, when you need the coordinates later ingame for some reason, you can store the coordinates too, along with the id.
pawn Код:
enum TPickup
{
pid, // Store the id of the pickup
Float:px, // Hold the x, y and z coordinates of the pickup
Float:py,
Float:pz
}
new MalaBombaPickup[MAX_PLAYERS][TPickup];
public OnDialogResponse(...)
{
if(dialogid == MALABOMBADIALOG)
{
if(listitem == 0)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
MalaBombaPickup[playerid][pid] = CreatePickup(1252, 1, X, Y, Z);
MalaBombaPickup[playerid][px] = X;
MalaBombaPickup[playerid][py] = Y;
MalaBombaPickup[playerid][pz] = Z;
SetTimerEx("MalaBombaDetonacija", 5000, false, "d", playerid);
}
}
return 1;
}