Problemas con 3dtextlabel
#1

Buenas buenas, siempre he tenido problema con esto pero ya quiero solucionarlo es algo molestoso ya y por mas que haga todo desde 0 me sigue pasando lo mismo pff.

PHP код:
CMD:aod(playeridparams[])
{
    
#pragma unused params
    
new
        
ARank[128],
        
string[128]
    ;
    if(
pInfo[playerid][AdminLevel] >= || 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(playeridMath.Infinite());
            
SetPlayerColor(playeridCOLOR_ADMIN);
            
TextDrawShowForPlayer(playeridTextdrawAOD[playerid]);
            
AODLabel[playerid] = CreateDynamic3DTextLabel(ARankCOLOR_ADMIN0.00.00.0+0.315.0playeridINVALID_VEHICLE_ID0, -1, -1);
             
AODLabel2[playerid] = CreateDynamic3DTextLabel("Admin on Duty!"COLOR_ADMIN0.00.00.0+0.415.0playeridINVALID_VEHICLE_ID0, -1, -1);
             
format(stringsizeof(string), "[ADMIN]"COL_WHITE" %s is now On Duty!, use /ask to formulate any question"GetPlayerName(playerid));
             
SendClientMessageToAll(COLOR_ADMINstring);
        }
        else if(
GetPVarInt(playerid"AODMODE") == 1)
        {
            
SetPVarInt(playerid"AODMODE"0);
            
SetPlayerColor(playeridCOLOR_WHITE);
            
SetPlayerHealth(playerid100);
            
DestroyDynamic3DTextLabel(AODLabel[playerid]);
            
DestroyDynamic3DTextLabel(AODLabel2[playerid]);
            
TextDrawHideForPlayer(playeridTextdrawAOD[playerid]);
            
format(stringsizeof(string), "[ADMIN]"COL_WHITE" %s is now Off Duty!"GetPlayerName(playerid));
             
SendClientMessageToAll(COLOR_ADMINstring);
        }
    }    else return 
ErrorMessages(playerid3);
    
    return 
1;
}
OnplayerSpawn tengoPor si muere en algun caso se ponga su color de nuevo y bla bla
if(GetPVarInt(playerid"AODMODE") == 1)
    {
        
SetPlayerHealth(playeridMath.Infinite());
        
SetPlayerColor(playeridCOLOR_ADMIN);
    } 
Bueno el problema es que yo fino activo mi aod, y lo quito y todo bien se quita el label pero en un rato de andar por ahi en el servidor el label se vuelve a poner sin yo estar AOD, intento ponerme el aod y quitarmelo para que se desaparezca y nada osea el label se queda hasta que yo reinicie el servidor D:, en serio quiero quitarme esta pesadilla porque hay jugadores que les aparece a veces hasta sin ser administrador
Reply
#2

Quote:

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]);
DestroyDynamic3DTextLabel(AODLabel[playerid]);
DestroyDynamic3DTextLabel(AODLabel2[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 if(GetPVarInt(playerid, "AODMODE") == 1)
{
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);

return 1;
}

Si no te funciona pasa el label que te lo hago de 0.
Reply
#3

Quote:
Originally Posted by Speedpro
Посмотреть сообщение
Si no te funciona pasa el label que te lo hago de 0.
ya probe agregando el destroy, pero esa funcion solo se ejecuta cuando uso label normal que es este. Porque el aduty es algo para los adm, y el label es normal para los jugadores para que pongan cualquier msj que quieran

PHP код:
CMD:label(playeridparams[])
{
    new
        
msg[128],
         
string[128],
         
COLORL[32],
         
LCOLOR COLOR_WHITE
     
;
    if(
GetPVarInt(playerid"AODMODE") == 1) return ErrorMessages(playerid8);
    if(
pInfo[playerid][VipLevel] == && pInfo[playerid][EXP] < 1000) return SendClientMessage(playeridCOLOR_ERROR"[ERROR]"COL_WHITE" You need 1000 EXP or VIP to use this command");
    if(
sscanf(params"s[128]"msg) && pInfo[playerid][VipLevel] == ) return SendClientMessage(playeridCOLOR_ORANGE"Usage:"COL_WHITE" /label [TEXT]");
    else if(
pInfo[playerid][VipLevel] >= 1)
    {
        if(
sscanf(params"s[128]s[32]"msgCOLORL))
        {
            
SendClientMessage(playeridCOLOR_ORANGE"Usage:"COL_WHITE" /label [TEXT][COLOR]");
            
SendClientMessage(playeridCOLOR_ORANGE"[__________ COLOR LIST __________]");
            
SendClientMessage(playerid, -1"{000000}Black"COL_WHITE"- ONLY VIP LEVEL 5");
            
SendClientMessage(playerid, -1"{00ffe9}Aqua"COL_WHITE"- ONLY VIP LEVEL 5");
            
SendClientMessage(playerid, -1"{ff007b}Pinkish"COL_WHITE"- ONLY VIP LEVEL 5");
            
SendClientMessage(playerid, -1"{f9ed00}Yellow");
            
SendClientMessage(playerid, -1"{00ff00}Green");
            
SendClientMessage(playerid, -1"{0083ff}Blue");
            
SendClientMessage(playerid, -1"{800080}Purple");
            
SendClientMessage(playerid, -1"{FF0000}Red");
            return 
SendClientMessage(playerid, -1"{ff2a00}Orange");
        }
    }
    if(
pInfo[playerid][VipLevel] < && !strcmp("Black"COLORLtrue)) return SendClientMessage(playeridCOLOR_ERROR"[ERROR]"COL_WHITE" You need VIP LEVEL 5 to use this colour");
    if(
pInfo[playerid][VipLevel] < && !strcmp("Aqua"COLORLtrue)) return SendClientMessage(playeridCOLOR_ERROR"[ERROR]"COL_WHITE" You need VIP LEVEL 5 to use this colour");
    if(
pInfo[playerid][VipLevel] < && !strcmp("Pinkish"COLORLtrue)) return SendClientMessage(playeridCOLOR_ERROR"[ERROR]"COL_WHITE" You need VIP LEVEL 5 to use this colour");
    else if(!
strcmp("Black"COLORLtrue)) LCOLOR 0x000000FF;
    else if(!
strcmp("Aqua"COLORLtrue)) LCOLOR 0x00ffe9FF;
    else if(!
strcmp("Pinkish"COLORLtrue)) LCOLOR 0xff007bFF;
    else if(!
strcmp("Yellow"COLORLtrue)) LCOLOR 0xf9ed00FF;
    else if(!
strcmp("Green"COLORLtrue)) LCOLOR 0x00ff00FF;
    else if(!
strcmp("Blue"COLORLtrue)) LCOLOR 0x0083ffFF;
    else if(!
strcmp("Purple"COLORLtrue)) LCOLOR 0x800080FF;
    else if(!
strcmp("Red"COLORLtrue)) LCOLOR 0xFF0000FF;
    else if(!
strcmp("Orange"COLORLtrue)) LCOLOR 0xff2a00FF;
    
format(stringsizeof(string), "%s"msg);
    if(
GetPVarInt(playerid"PlayerLabel") != 1)
    {
        
SetPVarInt(playerid"PlayerLabel"1);
        
PlayerLabel[playerid] = CreateDynamic3DTextLabel(stringLCOLOR0.00.00.0+0.415.0playeridINVALID_VEHICLE_ID0, -1, -1);
        
SendClientMessage(playeridCOLOR_SERVER"[LABEL]"COL_WHITE" It made you the label successfully");
    }
    else
    {
        
UpdateDynamic3DTextLabelText(PlayerLabel[playerid], LCOLORstring);
        
format(stringsizeof(string), "[LABEL]"COL_WHITE" You have changed your label to %s"msg);
        
SendClientMessage(playeridCOLOR_SERVERstring);
    }
    return 
1;

El problema es que llega un momento en el que yo me quito el aod y no se quita el 3dtext Admin On Duty!, sigue saliendo arriba de mi personaje, y sale el msj y todo que Player Off duty, osea que el comando si se ejecuta bien pero no se porque el destroy no sirve ni porque sin estar on duty derrepente aparece solo el 3dtext Admin On Duty!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)