Get's the last spraytag, previous not working.
#1

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(playerid1); 
                                        
ShowSprayTagMenu(playerid0); 
                                        return 
SendClientMessage(playeridCOLOR_RED"( ERROR ):This Slot is occupied!");
                                    }
                                    
pinfo[playerid][SprayTags]++;
                                    
                                    new 
Float:XFloat:YFloat:Z;
                                    
GetPlayerPos(playeridXYZ);
                                    
strins(TagInfo[playerid][tagid[playerid]][TagName], "graffiti"0);
                                    
TagInfo[playerid][tagid[playerid]][TagObject] = CreateDynamicObject(19482X+2Y+1Z0.00.00.0, -1, -1, -1300.0300.0);
                                    
SetDynamicObjectMaterialText(TagInfo[playerid][tagid[playerid]][TagObject], 0"graffiti"70"Ariel"221, -100);
                                    
TagInfo[playerid][tagid[playerid]][TagSlot] = 1;
                                    
PlayerPlaySound(playerid,1054,0.0,0.0,0.0); 
                                    
HideSprayTagMenu(playerid1); 
                                    
ShowSprayTagMenu(playerid2); 
                                    
                                    
                                }                    
                                
                                case 
2//Edit Spray Tag
                                
{
                                    if(
TagInfo[playerid][tagid[playerid]][TagSlot] == 1){ 
                                        
HideSprayTagMenu(playerid1); 
                                        
ShowSprayTagMenu(playerid2);
                                    }
                                    if(
TagInfo[playerid][tagid[playerid]][TagSlot] != 1){ 
                                        
HideSprayTagMenu(playerid1); 
                                        
ShowSprayTagMenu(playerid0); 
                                        return 
SendClientMessage(playeridCOLOR_RED,"( ERROR ): This Slot is empty!");
                                    }
                                    
                                }    
                                
                                case 
3//Delete Spray Tag
                                
{
                                    if(
TagInfo[playerid][tagid[playerid]][TagSlot] == 1){ 
                                        
HideSprayTagMenu(playerid1); 
                                        
ShowSprayTagMenu(playerid0); 
                                        
pinfo[playerid][SprayTags]--; 
                                        
TagInfo[playerid][tagid[playerid]][TagSlot] = -1
                                        
DestroyDynamicObject(TagInfo[playerid][tagid[playerid]][TagObject]);
                                        
SendClientMessage(playeridCOLOR_GREEN"( INFO ): You deleted a spray tag!");
                                    }
                                    if(
TagInfo[playerid][tagid[playerid]][TagSlot] != 1){ 
                                        
HideSprayTagMenu(playerid1); 
                                        
ShowSprayTagMenu(playerid0); 
                                        return 
SendClientMessage(playeridCOLOR_RED,"( ERROR ): This Slot is empty!");
                                    }
                                }
        
                            }
    
                        } 
Reply
#2

tagid[playerid]
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
tagid[playerid]
What is wrong with that or how could i resolve this?
Reply
#4

enum
TagID[3]

code: TagID[playerid][1]; //etc.
Reply
#5

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:XFloat:YFloat:Z;
                                    
GetPlayerPos(playeridXYZ);
                                    
strins(TagInfo[playerid][tagid[playerid]][TagName], "graffiti"0);
                                    
TagInfo[playerid][tagid[playerid]][TagObject] = CreateDynamicObject(19482X+2Y+1Z0.00.00.0, -1, -1, -1300.0300.0);
                                    
SetDynamicObjectMaterialText(TagInfo[playerid][tagid[playerid]][TagObject], 0"graffiti"70"Ariel"221, -100);
                                    
TagInfo[playerid][tagid[playerid]][TagSlot] = 1;
                                    
PlayerPlaySound(playerid,1054,0.0,0.0,0.0); 
                                    
HideSprayTagMenu(playerid1); 
                                    
ShowSprayTagMenu(playerid2); 
How should i replace it with that way you suggest?
Reply
#6

Anyone?
Reply
#7

When is tagid[playerid] set?
Reply
#8

I even tried setting it on creation but didn't work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)