10.01.2015, 16:11
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");
}