22.03.2014, 23:42
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);
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);