27.10.2016, 12:59
Will it be better If i change my enum to TagInfo[MAX_TAGS_PER_PLAYER][TagInformation], removing all [playerid] dimensions ?
Doing something like that:
at top of the script
Function
My command
Doing something like that:
at top of the script
PHP код:
new TagInfo[MAX_TAGS_PER_PLAYER][TagInformation], tagIndex = SprayTags_GetFreeSlot();
PHP код:
function SprayTag_GetFreeID()
{
for(new i = 0; i< MAX_TAGS_PER_PLAYER; i++) if(!TagInfo[i][TagExists]) return i;
return - 1;
}
PHP код:
CMD:create(playerid, params[])
{
if(tagIndex == -1) {
return SendClientMessage(playerid, -1, "You have reached the maximum amount of tags per player.");
}
TagInfo[playerid][tagIndex][TagObject] = CreateDynamicObject(19482, X, Y, Z, 0.0, 0.0, 0.0, -1, -1, -1, 300.0, 300.0);
return 1;
}