Try using OnPlayerPickUpPickup, first make sure you create a variable at the top of your script, then label it:
pawn Код:
variable = CreatePickup(1239, 23, 0.0, 0.0, 0.0);
Right beside CreatePickup.
Then use OnPlayerPickUpPickup to store the data, example:
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == variable)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PickupInfo[variable][PosX] = x;
PickupInfo[variable][PosY] = y;
PickupInfo[variable][PosZ] = z;
}
return 1;
}
Here is the enum at last.
pawn Код:
enum picinfo
{
Float:PosX,
Float:PosY,
Float:PosZ
};
new PickupInfo[MAX_PICKUPS][picinfo];
So you have all this in total:
pawn Код:
#include <a_samp>
enum picinfo
{
Float:PosX,
Float:PosY,
Float:PosZ
};
new PickupInfo[MAX_PICKUPS][picinfo];
public OnFilterScriptInit()
{
variable = CreatePickup(1239, 23, 0.0, 0.0, 0.0);
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == variable)
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
PickupInfo[variable][PosX] = x;
PickupInfo[variable][PosY] = y;
PickupInfo[variable][PosZ] = z;
}
return 1;
}