Posts: 458
Threads: 105
Joined: Nov 2013
Reputation:
0
im using AttachObjectToPlayer , but i dont know what is the function to remove the object
do anyone know?
Posts: 3,133
Threads: 71
Joined: Dec 2013
Reputation:
0
You'd wanna store the object ID in a variable or pVar. For instance when creating/attaching said object...
Object = CreateObject... your code is here...
SetPVarInt(playerid, "AttachedObject", Object);
And then to remove it you'd do:
new objectid = GetPVarInt(playerid, "AttachedObject");
DestroyObject(objectid);
Posts: 458
Threads: 105
Joined: Nov 2013
Reputation:
0
im not working with pvar!
i want to know how can i remove the attached object to a player without pvar
Posts: 277
Threads: 19
Joined: Sep 2013
Posts: 458
Threads: 105
Joined: Nov 2013
Reputation:
0
without command?
Example on player death remove attachmedobject
Posts: 277
Threads: 19
Joined: Sep 2013
I'm not sure if this will work.
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
if(IsPlayerAttachedObjectSlotUsed(playerid, i)) RemovePlayerAttachedObject(playerid, i);
}
return 1;
}