asking about remove object
#1

im using AttachObjectToPlayer , but i dont know what is the function to remove the object
do anyone know?
Reply
#2

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);
Reply
#3

im not working with pvar!
i want to know how can i remove the attached object to a player without pvar
Reply
#4

https://sampwiki.blast.hk/wiki/RemovePlayerAttachedObject
Reply
#5

without command?
Example on player death remove attachmedobject
Reply
#6

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)