Remove user created objects
#4

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.
Reply


Messages In This Thread
Remove user created objects - by luckie12 - 16.05.2014, 06:46
Re: Remove user created objects - by Lordzy - 16.05.2014, 06:52
Re: Remove user created objects - by luckie12 - 16.05.2014, 06:59
Re: Remove user created objects - by Lordzy - 16.05.2014, 08:17
Re: Remove user created objects - by luckie12 - 16.05.2014, 08:19
Re: Remove user created objects - by luckie12 - 16.05.2014, 16:13
Re: Remove user created objects - by luckie12 - 16.05.2014, 18:27
Re: Remove user created objects - by luckie12 - 17.05.2014, 14:50
Re: Remove user created objects - by Jefff - 17.05.2014, 15:25
Re: Remove user created objects - by luckie12 - 17.05.2014, 16:43

Forum Jump:


Users browsing this thread: 1 Guest(s)