No se ve el Rango [Consulta]
#1

Hola amigos del samp hice unos Textdraw para que se viera mis estadisticas en ello, pero el problema es que no sale el rango, ejemplo Semi-Pro, Noob, Intermedio.. Solo sale Rango: ?, Como puedo cambiar las variable de mi funcion para que se se ve el rango....

En el caso de Kills si se ve, la cantidad de muerte que tengo, por esto PlayerInfo[player1][Deaths] , aqui no hay problema ni el resto de mis estadisticas, pero en caso del rango no se ve.

pawn Код:
format(string, sizeof(string), "MUERTES: %d", PlayerInfo[player1][Deaths]);
pero en el caso de el Rango si pongo asн no se ve el nivel, porque pienso que rango no tiene las variables completas como el caso de arriba:

pawn Код:
format(string, sizeof(string), " RANGO: %s",rango);
No se si, tengo que poner algo asi: PlayerInfo[player1][rango] para que aparezca los niveles, no se estoy confundido?

Aqui mi funcion completa del rango:

pawn Код:
dcmd_stats(playerid,params[]) {
    new string[300],string2[128], pDeaths, player1, TimesOn;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);

        if(IsPlayerConnected(player1)) {
        TimesOn = dUserINT(PlayerName2(player1)).("TimesOnServer");
        if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
        new Vip[50];
        new rango[24];
    if((PlayerInfo[player1][Experiencia]>= -50000 && PlayerInfo[player1][Experiencia] <= -2000)) { rango = "Noob Pro"; }
    else if((PlayerInfo[player1][Experiencia]>= -1999 && PlayerInfo[player1][Experiencia] <= -300)) { rango = "Semi Noob"; }
    else if((PlayerInfo[player1][Experiencia]>= -299 && PlayerInfo[player1][Experiencia] <= -10)) { rango = "Noob"; }
    else if((PlayerInfo[player1][Experiencia]>= -9 && PlayerInfo[player1][Experiencia] <= 50)) { rango = "Novato"; }
    else if((PlayerInfo[player1][Experiencia]>= 51 && PlayerInfo[player1][Experiencia] <= 100)) { rango = "Semi Novato"; }
    else if((PlayerInfo[player1][Experiencia]>= 101 && PlayerInfo[player1][Experiencia] <= 1000)) { rango = "Novato Pro"; }
    else if((PlayerInfo[player1][Experiencia]>= 1001 && PlayerInfo[player1][Experiencia] <= 2000)) { rango = "Intermedio"; }
    else if((PlayerInfo[player1][Experiencia]>= 2001 && PlayerInfo[player1][Experiencia] <= 3000)) { rango = "Avanzado"; }
    else if((PlayerInfo[player1][Experiencia]>= 3001 && PlayerInfo[player1][Experiencia] <= 4000)) { rango = "Complejo"; }
    else if((PlayerInfo[player1][Experiencia]>= 4001 && PlayerInfo[player1][Experiencia] <= 5000)) { rango = "Sicario"; }
    else if((PlayerInfo[player1][Experiencia]>= 5001 && PlayerInfo[player1][Experiencia] <= 6000)) { rango = "Semi Pro"; }
    else if((PlayerInfo[player1][Experiencia]>= 6001 && PlayerInfo[player1][Experiencia] <= 7000)) { rango = "Pro"; }
    else if((PlayerInfo[player1][Experiencia]>= 7001 && PlayerInfo[player1][Experiencia] <= 8000)) { rango = "Pro Avanzado"; }
    else if((PlayerInfo[player1][Experiencia]>= 8001 && PlayerInfo[player1][Experiencia] <= 9000)) { rango = "Pro Gamer"; }
    else if((PlayerInfo[player1][Experiencia]>= 9001 && PlayerInfo[player1][Experiencia] <= 90000)) { rango = "Dios"; }

switch(PlayerInfo[player1][pVip])
{
case 0: Vip = "{FFFFFF}Normal";
case 1: Vip = "{3C3214}Silver";
case 2: Vip = "{C3D5DF}Gold";
case 3: Vip = "{DFC418}Premium";
case 4: Vip = "{209193}Platinum";
case 5: Vip = "{0C242E}Diamond";
}
        format(string2, sizeof(string2), "{00EEFF}%s ",PlayerName2(player1));
        format(string, sizeof(string), "{00FF00}* ASESINATOS: %d\n\n* MUERTES: %d\n\n* EXPERIENCIA: %d\n\n* NIVEL: %d\n\n* KDR: %0.2f\n\n{00FF00}* RANGO: {0328BB}%s\n\n{BCC3E1}{00FF00}* DINERO: $%d\n\n* VIP: %s\n\n{00FF00}* Tiempo en el SV: %d de Tiempo",PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], PlayerInfo[player1][Experiencia], PlayerInfo[player1][Nivel], Float:PlayerInfo[player1][Kills]/Float:pDeaths,rango,GetPlayerMoney(player1),Vip,TimesOn);
        return ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,string2,string,"Aceptar","");
    } else return SendClientMessage(playerid, red, "Jugador no conectado");
}
Edit: Agrego Imagen



que puedo hacer muchas gracias.
Reply
#2

pawn Код:
dcmd_stats(playerid,params[])
{
    new string[450],string2[128], pDeaths, player1, TimesOn;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    if(IsPlayerConnected(player1))
    {
        TimesOn = dUserINT(PlayerName2(player1)).("TimesOnServer");
        if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
        new Vip[50];
        new rango[24];
        if((PlayerInfo[player1][Experiencia]>= -50000 && PlayerInfo[player1][Experiencia] <= -2000)) { rango = "Noob Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= -1999 && PlayerInfo[player1][Experiencia] <= -300)) { rango = "Semi Noob"; }
        else if((PlayerInfo[player1][Experiencia]>= -299 && PlayerInfo[player1][Experiencia] <= -10)) { rango = "Noob"; }
        else if((PlayerInfo[player1][Experiencia]>= -9 && PlayerInfo[player1][Experiencia] <= 50)) { rango = "Novato"; }
        else if((PlayerInfo[player1][Experiencia]>= 51 && PlayerInfo[player1][Experiencia] <= 100)) { rango = "Semi Novato"; }
        else if((PlayerInfo[player1][Experiencia]>= 101 && PlayerInfo[player1][Experiencia] <= 1000)) { rango = "Novato Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= 1001 && PlayerInfo[player1][Experiencia] <= 2000)) { rango = "Intermedio"; }
        else if((PlayerInfo[player1][Experiencia]>= 2001 && PlayerInfo[player1][Experiencia] <= 3000)) { rango = "Avanzado"; }
        else if((PlayerInfo[player1][Experiencia]>= 3001 && PlayerInfo[player1][Experiencia] <= 4000)) { rango = "Complejo"; }
        else if((PlayerInfo[player1][Experiencia]>= 4001 && PlayerInfo[player1][Experiencia] <= 5000)) { rango = "Sicario"; }
        else if((PlayerInfo[player1][Experiencia]>= 5001 && PlayerInfo[player1][Experiencia] <= 6000)) { rango = "Semi Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= 6001 && PlayerInfo[player1][Experiencia] <= 7000)) { rango = "Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= 7001 && PlayerInfo[player1][Experiencia] <= 8000)) { rango = "Pro Avanzado"; }
        else if((PlayerInfo[player1][Experiencia]>= 8001 && PlayerInfo[player1][Experiencia] <= 9000)) { rango = "Pro Gamer"; }
        else if((PlayerInfo[player1][Experiencia]>= 9001 && PlayerInfo[player1][Experiencia] <= 90000)) { rango = "Dios"; }
        switch(PlayerInfo[player1][pVip])
        {
            case 0: Vip = "{FFFFFF}Normal";
            case 1: Vip = "{3C3214}Silver";
            case 2: Vip = "{C3D5DF}Gold";
            case 3: Vip = "{DFC418}Premium";
            case 4: Vip = "{209193}Platinum";
            case 5: Vip = "{0C242E}Diamond";
        }
        format(string2, sizeof(string2), "{00EEFF}%s",PlayerName2(player1));// Titulo del dialog.
        format(string, sizeof(string),  "%s{00FF00}* ASESINATOS: %d\n\n",string, PlayerInfo[player1][Kills]);
        format(string, sizeof(string),  "%sMUERTES: %d\n\n*",string, PlayerInfo[player1][Deaths]);
        format(string, sizeof(string),  "%sEXPERIENCIA: %d\n\n*",string, PlayerInfo[player1][Experiencia]);
        format(string, sizeof(string),  "%sNIVEL: %d\n\n*",string, PlayerInfo[player1][Nivel]);
        format(string, sizeof(string),  "%sKDR: %d\n\n",string, PlayerInfo[player1][Kills]/PlayerInfo[player1][Deaths]); //lo tenias como Float si es asi usa %f
        format(string, sizeof(string),  "%sRANGO: {0328BB}%s\n\n",string, rango);
        format(string, sizeof(string),  "%s{00FF00}* DINERO: $%d\n\n",string, GetPlayerMoney(player1));
        format(string, sizeof(string),  "%s{BCC3E1}* VIP: %s\n\n",string, Vip);
        format(string, sizeof(string),  "%s{00FF00}* Tiempo en el SV: %d",string, TimesOn);
        return ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,string2,string,"Aceptar","");
    } else return SendClientMessage(playerid, red, "Jugador no conectado");
}
Reply
#3

Quote:
Originally Posted by jotajeda
Посмотреть сообщение
pawn Код:
dcmd_stats(playerid,params[])
{
    new string[450],string2[128], pDeaths, player1, TimesOn;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    if(IsPlayerConnected(player1))
    {
        TimesOn = dUserINT(PlayerName2(player1)).("TimesOnServer");
        if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
        new Vip[50];
        new rango[24];
        if((PlayerInfo[player1][Experiencia]>= -50000 && PlayerInfo[player1][Experiencia] <= -2000)) { rango = "Noob Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= -1999 && PlayerInfo[player1][Experiencia] <= -300)) { rango = "Semi Noob"; }
        else if((PlayerInfo[player1][Experiencia]>= -299 && PlayerInfo[player1][Experiencia] <= -10)) { rango = "Noob"; }
        else if((PlayerInfo[player1][Experiencia]>= -9 && PlayerInfo[player1][Experiencia] <= 50)) { rango = "Novato"; }
        else if((PlayerInfo[player1][Experiencia]>= 51 && PlayerInfo[player1][Experiencia] <= 100)) { rango = "Semi Novato"; }
        else if((PlayerInfo[player1][Experiencia]>= 101 && PlayerInfo[player1][Experiencia] <= 1000)) { rango = "Novato Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= 1001 && PlayerInfo[player1][Experiencia] <= 2000)) { rango = "Intermedio"; }
        else if((PlayerInfo[player1][Experiencia]>= 2001 && PlayerInfo[player1][Experiencia] <= 3000)) { rango = "Avanzado"; }
        else if((PlayerInfo[player1][Experiencia]>= 3001 && PlayerInfo[player1][Experiencia] <= 4000)) { rango = "Complejo"; }
        else if((PlayerInfo[player1][Experiencia]>= 4001 && PlayerInfo[player1][Experiencia] <= 5000)) { rango = "Sicario"; }
        else if((PlayerInfo[player1][Experiencia]>= 5001 && PlayerInfo[player1][Experiencia] <= 6000)) { rango = "Semi Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= 6001 && PlayerInfo[player1][Experiencia] <= 7000)) { rango = "Pro"; }
        else if((PlayerInfo[player1][Experiencia]>= 7001 && PlayerInfo[player1][Experiencia] <= 8000)) { rango = "Pro Avanzado"; }
        else if((PlayerInfo[player1][Experiencia]>= 8001 && PlayerInfo[player1][Experiencia] <= 9000)) { rango = "Pro Gamer"; }
        else if((PlayerInfo[player1][Experiencia]>= 9001 && PlayerInfo[player1][Experiencia] <= 90000)) { rango = "Dios"; }
        switch(PlayerInfo[player1][pVip])
        {
            case 0: Vip = "{FFFFFF}Normal";
            case 1: Vip = "{3C3214}Silver";
            case 2: Vip = "{C3D5DF}Gold";
            case 3: Vip = "{DFC418}Premium";
            case 4: Vip = "{209193}Platinum";
            case 5: Vip = "{0C242E}Diamond";
        }
        format(string2, sizeof(string2), "{00EEFF}%s",PlayerName2(player1));// Titulo del dialog.
        format(string, sizeof(string),  "%s{00FF00}* ASESINATOS: %d\n\n",string, PlayerInfo[player1][Kills]);
        format(string, sizeof(string),  "%sMUERTES: %d\n\n*",string, PlayerInfo[player1][Deaths]);
        format(string, sizeof(string),  "%sEXPERIENCIA: %d\n\n*",string, PlayerInfo[player1][Experiencia]);
        format(string, sizeof(string),  "%sNIVEL: %d\n\n*",string, PlayerInfo[player1][Nivel]);
        format(string, sizeof(string),  "%sKDR: %d\n\n",string, PlayerInfo[player1][Kills]/PlayerInfo[player1][Deaths]); //lo tenias como Float si es asi usa %f
        format(string, sizeof(string),  "%sRANGO: {0328BB}%s\n\n",string, rango);
        format(string, sizeof(string),  "%s{00FF00}* DINERO: $%d\n\n",string, GetPlayerMoney(player1));
        format(string, sizeof(string),  "%s{BCC3E1}* VIP: %s\n\n",string, Vip);
        format(string, sizeof(string),  "%s{00FF00}* Tiempo en el SV: %d",string, TimesOn);
        return ShowPlayerDialog(playerid,1,DIALOG_STYLE_MSGBOX,string2,string,"Aceptar","");
    } else return SendClientMessage(playerid, red, "Jugador no conectado");
}
No se ve igual



que sera
Reply
#4

Quote:
Originally Posted by Zodiaco
Посмотреть сообщение
No se ve igual



que sera
Pero lo de la foto son textdraw no el dialog, estas confundido.
pawn Код:
ShowPlayerDialog
Reply
#5

Quote:
Originally Posted by jotajeda
Посмотреть сообщение
Pero lo de la foto son textdraw no el dialog, estas confundido.
pawn Код:
ShowPlayerDialog
Si mis funciones le remplaze en mi Textdraw

pawn Код:
if(IsPlayerNPC(playerid)) return 0;
susfps[playerid] = GetPlayerFPS(playerid);

format(String, sizeof(String), "~g~~h~~h~dm Score: ~w~%d ~y~- ~r~~h~kills: ~w~%d ~y~- ~r~~h~~h~~h~~h~~h~Nivel: ~w~%d ~y~- ~b~~h~Exp: ~w~%d ~y~- ~y~~h~Fps: ~w~%d",GetPlayerScore(playerid),PlayerInfo[player1][Deaths],PlayerInfo[player1][Nivel], PlayerInfo[player1][Experiencia],susfps[playerid]);
TextDrawSetString(TextdeFps[playerid], String);
Por eso, las variables las copie de arriba y me salio bien, pero solo el Rango no sale nada, por eso pense que rango deberia ira con alguna varible adicional como esta PlayerInfo[player1][Nivel] para que salga el Rango que lleva cada user.

asi. PlayerInfo[player1][rango]

pawn Код:
GetPlayerScore(playerid),PlayerInfo[player1][Deaths],PlayerInfo[player1][Nivel], PlayerInfo[player1][Experiencia],susfps[playerid]
Reply
#6

Quote:
Originally Posted by Zodiaco
Посмотреть сообщение
Si mis funciones le remplaze en mi Textdraw

pawn Код:
if(IsPlayerNPC(playerid)) return 0;
susfps[playerid] = GetPlayerFPS(playerid);

format(String, sizeof(String), "~g~~h~~h~dm Score: ~w~%d ~y~- ~r~~h~kills: ~w~%d ~y~- ~r~~h~~h~~h~~h~~h~Nivel: ~w~%d ~y~- ~b~~h~Exp: ~w~%d ~y~- ~y~~h~Fps: ~w~%d",GetPlayerScore(playerid),PlayerInfo[player1][Deaths],PlayerInfo[player1][Nivel], PlayerInfo[player1][Experiencia],susfps[playerid]);
TextDrawSetString(TextdeFps[playerid], String);
Por eso, las variables las copie de arriba y me salio bien, pero solo el Rango no sale nada, por eso pense que rango deberia ira con alguna varible adicional como esta PlayerInfo[player1][Nivel] para que salga el Rango que lleva cada user.

asi. PlayerInfo[player1][rango]

pawn Код:
GetPlayerScore(playerid),PlayerInfo[player1][Deaths],PlayerInfo[player1][Nivel], PlayerInfo[player1][Experiencia],susfps[playerid]
No es necesario porque ya tienes
PlayerInfo[player1][Experiencia]
Y el rango es simplemente una cadena, tienes que meter esa cadena para el textdraw..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)