Get's the last spraytag, previous not working. -
vassilis - 30.11.2016
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:
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!");
}
}
}
}
Re: Get's the last spraytag, previous not working. -
SickAttack - 30.11.2016
tagid[playerid]
Re: Get's the last spraytag, previous not working. -
vassilis - 30.11.2016
Quote:
Originally Posted by SickAttack
tagid[playerid]
|
What is wrong with that or how could i resolve this?
Re: Get's the last spraytag, previous not working. -
BrianFaria - 30.11.2016
enum
TagID[3]
code: TagID[playerid][1]; //etc.
Re: Get's the last spraytag, previous not working. -
vassilis - 30.11.2016
Quote:
Originally Posted by Speedpro
enum
TagID[3]
code: TagID[playerid][1]; //etc.
|
How this could resolve it?
For example at code:
PHP код:
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);
How should i replace it with that way you suggest?
Re: Get's the last spraytag, previous not working. -
vassilis - 01.12.2016
Anyone?
Re: Get's the last spraytag, previous not working. -
SickAttack - 01.12.2016
When is tagid[playerid] set?
Re: Get's the last spraytag, previous not working. -
vassilis - 01.12.2016
I even tried setting it on creation but didn't work