16.05.2014, 08:17
Sure, here you go:
pawn Код:
new pObject[MAX_PLAYERS] = {INVALID_OBJECT_ID, ...};
public OnPlayerConnect(playerid)
{
pObject[playerid] = INVALID_OBJECT_ID; //Resetting the variable so that there won't be further confusion.
return 1;
}
//While creating object.
pObject[playerid] = CreateObject(....);
//While destroying the object:
DestroyObject(pObject[playerid]);
pObject[playerid] = INVALID_OBJECT_ID; //Also assign that array then to it's default value so later collission could be avoided.
//For checking if player has already created that stuff.
if(pObject[playerid] != INVALID_OBJECT_ID) //If the objectid array isn't at the invalid value, it means the object is created.