Help me with this command
#1

Hi, I created this command to give tags to players, When I do /givetag to player 1, it works properly, but when the player 2 gives a tag to player 1.
Player 1 tag disappear.

Here is the code:

Also when I do /givetag.
It keeps with the same text.

PHP код:
new Tagged[MAX_PLAYERS];
new 
Text3D:label;
CMD:givetag(playeridparams[])
{
    new 
targetid; new text[128]; new color[64];
    if(
sscanf(params"us[128]s[64]",targetidtextcolor)) return SendClientMessage(playeridCOLOR_LIGHTBLUE"USAGE: /givetag  [ID] [Text] [Color]");
    
    if (
Tagged[targetid] == 1) return SendClientMessage(playeridCOLOR_RED"ERROR: Player already has a tag");
    if(
strcmp(color"green"true) == 0)
    {
       
Create3DTextLabel(textCOLOR_GREEN0,0,0,70.5,1);
    
Attach3DTextLabelToPlayer(labeltargetid0.00.00.45);
    
Tagged[targetid] = 1;
    }
       else if(
strcmp(color"blue"true) == 0)
    {
       
Create3DTextLabel(textCOLOR_BLUE0,0,0,70.5,1);
    
Attach3DTextLabelToPlayer(labeltargetid0.00.00.45);
    
Tagged[targetid] = 1;
    }
       else if(
strcmp(color"gold"true) == 0)
    {
    
Create3DTextLabel(textCOLOR_GOLD0,0,0,70.5,1);
    
Attach3DTextLabelToPlayer(labeltargetid0.00.00.45);
    
Tagged[targetid] = 1;
    }
       else if(
strcmp(color"yellow"true) == 0)
    {
    
Create3DTextLabel(textCOLOR_YELLOW0,0,0,70.5,1);
    
Attach3DTextLabelToPlayer(labeltargetid0.00.00.45);
    
Tagged[targetid] = 1;
    }
       else if(
strcmp(color"brown"true) == 0)
    {
    
Create3DTextLabel(textCOLOR_BROWN,0,0,0,70.5,1);
    
Attach3DTextLabelToPlayer(labeltargetid,0.00.00.45);
    
Tagged[targetid] = 1;
    }
       else if(
strcmp(color"white"true) == 0)
    {
    
Create3DTextLabel(textCOLOR_WHITE0,0,0,70.5,1);
    
Attach3DTextLabelToPlayer(labeltargetid,0.00.00.45);
    
Tagged[targetid] = 1;
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)