26.04.2012, 22:17
why would oyu need a zcmd?
just use the standard onplayercommand, save the objectid to an array and when deleting set that value to something like -1. when typing flare or sflare you just check if the flare objectid for that player is -1 and act acordingly (meaning that a player with no flare can't delete random objects with the id of his last flare and a player can't have 2 flares)
like this
im sure you can change it to your likings
just use the standard onplayercommand, save the objectid to an array and when deleting set that value to something like -1. when typing flare or sflare you just check if the flare objectid for that player is -1 and act acordingly (meaning that a player with no flare can't delete random objects with the id of his last flare and a player can't have 2 flares)
like this
Код:
// global new PlayerFlareObject[MAX_PLAYERS]; // in on player command text if (!strcmp(cmd,"/flare",true)) { if (PlayerFlareObject[playerid] == -1) // player haves no flare, create it { PlayerFlareObject[playerid] = CreateObject(bla); } else // player haves a flare, delete it { DestroyObject(PlayerFlareObject[playerid]); PlayerFlareObject[playerid] = -1; } return 1; }