3Dtextlabel problem plap
#1

The command works perfect, but sometimes one removes the aod and the label is not removed. But the color of the player if it returns to be white.As there are also sometimes that when the aod is activated the label is not shown

pawn Код:
CMD:aod(playerid, params[])
{
    #pragma unused params
    new
        ARank[128],
        string[128]
    ;
    if(pInfo[playerid][AdminLevel] >= 1 || !IsPlayerAdmin(playerid))
    {
        if(GetPVarInt(playerid, "AODMODE") != 1)
        {
               if(IsPlayerAdmin(playerid))
            {
                ARank = "Rcon Owner";
            }
               else
               {
                switch(pInfo[playerid][AdminLevel])
                {
                    case 1: {ARank = "Beginner Admin";}
                    case 2: {ARank = "Secretary";}
                    case 3: {ARank = "Admin Instructor";}
                    case 4: {ARank = "Director Admin";}
                    case 5: {ARank = "Owner";}
                }
            }
           
            if(GetPVarInt(playerid, "PlayerLabel") == 1)
                {
                      SetPVarInt(playerid, "PlayerLabel", 0);
                      DestroyDynamic3DTextLabel(PlayerLabel[playerid]);
            }
           
                 SetPVarInt(playerid, "AODMODE", 1);
                 SetPlayerHealth(playerid, Math.Infinite());
                     SetPlayerColor(playerid, COLOR_ADMIN);
                     TextDrawShowForPlayer(playerid, TextdrawAOD[playerid]);
                     AODLabel[playerid] = CreateDynamic3DTextLabel(ARank, COLOR_ADMIN, 0.0, 0.0, 0.0+0.3, 15.0, playerid, INVALID_VEHICLE_ID, 0, -1, -1);
            AODLabel2[playerid] = CreateDynamic3DTextLabel("Admin on Duty!", COLOR_ADMIN, 0.0, 0.0, 0.0+0.4, 15.0, playerid, INVALID_VEHICLE_ID, 0, -1, -1);
            format(string, sizeof(string), "[ADMIN]"COL_WHITE" %s is now On Duty!, use /ask to formulate any question", GetPlayerName(playerid));
            SendClientMessageToAll(COLOR_ADMIN, string);
        }
        else
        {
            SetPVarInt(playerid, "AODMODE", 0);
            SetPlayerColor(playerid, COLOR_WHITE);
            SetPlayerHealth(playerid, 100);
            DestroyDynamic3DTextLabel(AODLabel[playerid]);
            DestroyDynamic3DTextLabel(AODLabel2[playerid]);
            TextDrawHideForPlayer(playerid, TextdrawAOD[playerid]);
            format(string, sizeof(string), "[ADMIN]"COL_WHITE" %s is now Off Duty!", GetPlayerName(playerid));
            SendClientMessageToAll(COLOR_ADMIN, string);
        }
    }
    else return ErrorMessages(playerid, 3);
}

And under OnPlayerConnect put SetPVarInt(playerid, "AODMODE", -1);
Reply
#2

BUMP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)