Tag Mismatch
#1

Код:
C:\Users\user\Desktop\slrp_main.pwn(64226) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64231) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64233) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64233) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64233) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64235) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64236) : warning 213: tag mismatch
C:\Users\user\Desktop\slrp_main.pwn(64236) : warning 213: tag mismatch
pawn Код:
CMD:astatus(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new astatus[32], string[128], PlayerText3D:adminstatus, LabelPos[3];

        if(sscanf(params, "s[32]", astatus)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /astatus [status/off]");
        if(strcmp(params, "off", true) == 0)
        {
            Delete3DTextLabel(adminstatus); // Line 64226
            DeletePlayer3DTextLabel(playerid, adminstatus);
            SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled your admin status");
            return 1;
        }
        DestroyDynamic3DTextLabel(adminstatus); // Line 64231
        DeletePlayer3DTextLabel(playerid, adminstatus);
        GetPlayerPos(playerid, LabelPos[0], LabelPos[1], LabelPos[2]); // Line 64233
        format(astatus, sizeof(astatus), "%s", params);
        adminstatus = CreateDynamic3DTextLabel(astatus, COLOR_YELLOW, LabelPos[0], LabelPos[1], LabelPos[2], 10.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); // Line 64235
        Attach3DTextLabelToPlayer(playerid, adminstatus, 0.0, 0.0, 0.7); // Line 64236
        format(string, sizeof(string), "You have set your admin status to %s", astatus);
        SendClientMessageEx(playerid, COLOR_WHITE, string);
    }
    else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
    return 1;
}
Reply
#2

U can't use a variable declared as 3DText for Player3DText functions...to create variables separately, and preferably global.
Reply
#3

Still need help, same warnings.
Reply
#4

pawn Код:
//Global - Top
new PlayerText3D:adminstatus,
      Text3D:_adminstatus;


//Command
CMD:astatus(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new astatus[32], string[128], Float:LabelPos[3];

        if(sscanf(params, "s[32]", astatus)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /astatus [status/off]");
        if(strcmp(params, "off", true) == 0)
        {
            DestroyDynamic3DTextLabel(_adminstatus); // Line 64226
            DeletePlayer3DTextLabel(playerid, adminstatus);
            SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled your admin status");
            return 1;
        }
        DestroyDynamic3DTextLabel(_adminstatus); // Line 64231
        DeletePlayer3DTextLabel(playerid, adminstatus);
        GetPlayerPos(playerid, LabelPos[0], LabelPos[1], LabelPos[2]); // Line 64233
        format(astatus, sizeof(astatus), "%s", params);
        _adminstatus = CreateDynamic3DTextLabel(astatus, COLOR_YELLOW, LabelPos[0], LabelPos[1], LabelPos[2], 10.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); // Line 64235
        Attach3DTextLabelToPlayer(playerid, _adminstatus, 0.0, 0.0, 0.7); // Line 64236
        format(string, sizeof(string), "You have set your admin status to %s", astatus);
        SendClientMessageEx(playerid, COLOR_WHITE, string);
    }
    else SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");
    return 1;
}
One thing I still don't understand, why these two labels to use...if you prefer, use this code:
pawn Код:
//Global - Top
new Text3D:adminstatus[MAX_PLAYERS];


//Command
CMD:astatus(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command.");

    new astatus[32],
              string[67],
              Float:LabelPos[3];

    if(sscanf(params, "s[32]", astatus)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /astatus [status/off]");

    if(!strcmp(astatus, "off", true))
    {
        if(IsValidDynamic3DTextLabel(adminstatus[playerid])) DestroyDynamic3DTextLabel(adminstatus[playerid]);

        SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled your admin status");

        return 1;
    }

    if(IsValidDynamic3DTextLabel(adminstatus[playerid])) DestroyDynamic3DTextLabel(adminstatus[playerid]);

    GetPlayerPos(playerid, LabelPos[0], LabelPos[1], LabelPos[2]);

    format(astatus, sizeof(astatus), "%s", astatus);

    adminstatus[playerid] = CreateDynamic3DTextLabel(astatus, COLOR_YELLOW, LabelPos[0], LabelPos[1], LabelPos[2], 10.0, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid));
    Attach3DTextLabelToPlayer(playerid, adminstatus[playerid], 0.0, 0.0, 0.7);

    format(string, sizeof(string), "You have set your admin status to %s", astatus);
    SendClientMessageEx(playerid, COLOR_WHITE, string);

    return 1;
}
Reply
#5

Works fine, thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)