30.11.2016, 23:12
Tittle explains what really happens. If you create second spray tag first is not really working.
I am working with 3 spray tag slots
for example if you click to create one then it shows 3 slots (empty/occupied) you choose one and then go at spray creating menu.(if it's empty slot)
Showing you code from first slot as its exactly same with other 2 slots too.
I guess it can't seperate spray tags as ID's .. How could i implement that?
my enum:
I am working with 3 spray tag slots
for example if you click to create one then it shows 3 slots (empty/occupied) you choose one and then go at spray creating menu.(if it's empty slot)
Showing you code from first slot as its exactly same with other 2 slots too.
I guess it can't seperate spray tags as ID's .. How could i implement that?
my enum:
PHP код:
enum TagInformation
{
TagID,
bool:TagExists,
TagObject,
TagName[24],
TagSlot,
TagOwner[MAX_PLAYER_NAME],
TagFont[25],
TagFontColor,
TagBold,
TagFontSize,
Text3D:TagAdminInfo,
Float:TagX,
Float:TagY,
Float:TagZ,
Float:TagRX,
Float:TagRY,
Float:TagRZ,
}
new TagInfo[MAX_PLAYERS][MAX_TAGS_PER_PLAYER][TagInformation], tagid[MAX_PLAYERS] = 0;
PHP код:
if(clickedid == SprayTagTD[11]) //First Slot
{
switch(MenuOption[playerid])
{
case 1: //Create Spray Tag
{
if(TagInfo[playerid][tagid[playerid]][TagSlot] == 1){
HideSprayTagMenu(playerid, 1);
ShowSprayTagMenu(playerid, 0);
return SendClientMessage(playerid, COLOR_RED, "( ERROR ):This Slot is occupied!");
}
pinfo[playerid][SprayTags]++;
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
strins(TagInfo[playerid][tagid[playerid]][TagName], "graffiti", 0);
TagInfo[playerid][tagid[playerid]][TagObject] = CreateDynamicObject(19482, X+2, Y+1, Z, 0.0, 0.0, 0.0, -1, -1, -1, 300.0, 300.0);
SetDynamicObjectMaterialText(TagInfo[playerid][tagid[playerid]][TagObject], 0, "graffiti", 70, "Ariel", 22, 1, -1, 0, 0);
TagInfo[playerid][tagid[playerid]][TagSlot] = 1;
PlayerPlaySound(playerid,1054,0.0,0.0,0.0);
HideSprayTagMenu(playerid, 1);
ShowSprayTagMenu(playerid, 2);
}
case 2: //Edit Spray Tag
{
if(TagInfo[playerid][tagid[playerid]][TagSlot] == 1){
HideSprayTagMenu(playerid, 1);
ShowSprayTagMenu(playerid, 2);
}
if(TagInfo[playerid][tagid[playerid]][TagSlot] != 1){
HideSprayTagMenu(playerid, 1);
ShowSprayTagMenu(playerid, 0);
return SendClientMessage(playerid, COLOR_RED,"( ERROR ): This Slot is empty!");
}
}
case 3: //Delete Spray Tag
{
if(TagInfo[playerid][tagid[playerid]][TagSlot] == 1){
HideSprayTagMenu(playerid, 1);
ShowSprayTagMenu(playerid, 0);
pinfo[playerid][SprayTags]--;
TagInfo[playerid][tagid[playerid]][TagSlot] = -1;
DestroyDynamicObject(TagInfo[playerid][tagid[playerid]][TagObject]);
SendClientMessage(playerid, COLOR_GREEN, "( INFO ): You deleted a spray tag!");
}
if(TagInfo[playerid][tagid[playerid]][TagSlot] != 1){
HideSprayTagMenu(playerid, 1);
ShowSprayTagMenu(playerid, 0);
return SendClientMessage(playerid, COLOR_RED,"( ERROR ): This Slot is empty!");
}
}
}
}