19.11.2016, 06:34
You are deleting the object before you check if its valid or not so obviously it won't be valid as the object has already been deleted!!
Use this :
Use this :
PHP код:
if(sscanf(params, "i",id)) return SendClientMessage(playerid,yellow,"Usage: /delobject <Object ID>");
if(!IsValidObject(id)) return SendClientMessage(playerid,red, "Error: Invalid object!");// PLACE THIS LINE HERE NOT AFTER FORMAT
DestroyObject(id);
CommandToAdmins(playerid,"delobject");
format(Jstring, sizeof(Jstring), "You have deteled the Object ID: '%d'", id);
return SendClientMessage(playerid,yellow, Jstring);