12.04.2014, 00:38
So, if i add a few objects and do /deleteobject 1
after i delete this one and add another object, it is supposed to spawn as id 1 since i removed it, but it is getting created as a id that already excists, so multiple ids so when i remove one object the other one is still there....
after i delete this one and add another object, it is supposed to spawn as id 1 since i removed it, but it is getting created as a id that already excists, so multiple ids so when i remove one object the other one is still there....
pawn Код:
CMD:deleteobject(playerid, params[])
{
new objectid;
if(IsPlayerEditingObject[playerid] == 1) CancelEdit(playerid);
if(PlayerObjectCount[playerid] == 0 ) return SendClientMessage(playerid, COLOR_RED, "Invalid Object ID.");
if(!IsValidDynamicObject(PlayerObject[playerid][objectid]) || objectid < 1) return SendClientMessage(playerid, COLOR_RED, "Invalid Object Editing ID.");
DestroyDynamicObject(PlayerObject[playerid][objectid]);
PlayerObject[playerid][objectid] = INVALID_OBJECT_ID;
PlayerObjectCount[playerid]--;
return 1;
}