No se muestra el dialogo
#1

Buenas, estoy tratando de hacer un dialog de estadisticas pero cuando lo pruebo, me sale que es un comando desconocido.


Este es el codigo:
PHP код:
COMMAND:stats(playerid,params[])
{
    new 
idplayer,titstr[100],infstr[1650];
    new 
paisstring[100];
    
GetPlayerCountry(playerid,paisstring,sizeof(paisstring));
    new 
ligatxt[70];
    switch(
Player[playerid][Liga])
    {
        case 
0ligatxt "Ninguna";
        case 
1ligatxt "Liga de Bronce";
        case 
2ligatxt "Liga de Plata";
        case 
3ligatxt "Liga de Oro";
        case 
4ligatxt "Liga de Cristal";
        case 
5ligatxt "Liga de Maestros";
        case 
6ligatxt "Liga de Campeones";
        case 
7ligatxt "Liga de Titanes";
        case 
8ligatxt "Liga de Leyendas";
    }
    new 
Float:pPacket GetPlayerPacketLoss(playerid);
    
format(titstr,sizeof(titstr),"{FFFFFF}%s {0ECEF0}Estadisticas",pName(playerid));
    
format(infstr,sizeof(infstr),"{FFFFFF}%s\n",pName(playerid));
    
format(infstr,sizeof(infstr),"%s{0ECEF0}Pais: {FFFFFF}%s\n\n",infstr,paisstring);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Liga: {FFFFFF}%s\t\t\t",infstr,ligatxt);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Asesinatos: {FFFFFF}%d\t\t\t",infstr,Player[playerid][Kills]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}FPS: {FFFFFF}%d\n",infstr,GetPlayerFPS(playerid));
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Trofeos: {FFFFFF}%d\t\t\t\t",infstr,Player[playerid][Trofeos]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Muertes: {FFFFFF}%d\t\t\t\t",infstr,Player[playerid][Deaths]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Ping: {FFFFFF}%d\n",infstr,GetPlayerPing(playerid));
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Experiencia: {FFFFFF}%d\t\t\t",infstr,Player[playerid][Experiencia]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}KDR: {FFFFFF}%0.2f\t\t\t\t",infstr,Player[playerid][Kills]/Player[playerid][Deaths]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Packet-Loss: {FFFFFF}%0.2f\n\n",infstr,pPacket);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Hits: {FFFFFF}%d\t\t\t\t",infstr,Player[playerid][TotalHits]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Duelos Ganados: {FFFFFF}%d\t\t\t",infstr,Player[playerid][DuelosGanados]);
    new 
txtclan[156];
    if(
Player[playerid][Clan] == 0txtclan "Huerfano";
    if(
Player[playerid][Clan] != 0txtclan GetGangName(Player[playerid][Clan]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Pandilla: {FFFFFF}%s\n",infstr,GetGangName(Player[playerid][Clan]));
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Daсo: {FFFFFF}%d\t\t\t\t",infstr,Player[playerid][TotalDamage]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Duelos Perdidos: {FFFFFF}%d\t\t\t",infstr,Player[playerid][DuelosPerdidos]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Rango: {FFFFFF}%s\n",infstr,GetRankName(playerid));
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Arma Preferida: {FFFFFF}Nada\t\t\t",infstr);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Valoraciуn: {FFFFFF}%0.2f\t\t\t",infstr,Player[playerid][DuelosGanados]/Player[playerid][DuelosPerdidos]);
    
format(infstr,sizeof(infstr),"%s{FF6666}- {FF6666}Reputaciуn: {FFFFFF}%0.2f\t\t\t\t",infstr,pPacket);
    if(
sscanf(params,"u",idplayer))
    {
     
//   strcat(infstr,"",sizeof(infstr));
        
ShowPlayerDialog(playerid,DIALOGO_STATS,DIALOG_STYLE_MSGBOX,titstr,infstr,"Aceptar","");
    }
    return 
1;

Reply
#2

Prueba asн:

pawn Код:
COMMAND:stats(playerid,params[])
{
    new idplayer,string[500],st[500];;
    new ligatxt[70];
    switch(Player[playerid][Liga])
    {
        case 0: ligatxt = "Ninguna";
        case 1: ligatxt = "Liga de Bronce";
        case 2: ligatxt = "Liga de Plata";
        case 3: ligatxt = "Liga de Oro";
        case 4: ligatxt = "Liga de Cristal";
        case 5: ligatxt = "Liga de Maestros";
        case 6: ligatxt = "Liga de Campeones";
        case 7: ligatxt = "Liga de Titanes";
        case 8: ligatxt = "Liga de Leyendas";
    }
    format(st,sizeof(st),"Liga: %s | Asesinatos: %d | FPS: %d",
    ligatxt, Player[playerid][Kills],GetPlayerFPS(playerid);
    strcat(string,st,sizeof(string));
    ShowPlayerDialog(playerid,DIALOGO_STATS,DIALOG_STYLE_MSGBOX,"Tus stats",string,"Aceptar","");
    return 1;
}
Te lo hice como ejemplo, ya te toca poner a ti lo demбs y ajusta los valores de los strings.
Reply
#3

Solucionado, era simplemente definir Float: en la division para "valoracion" y "kdr"
PHP код:
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}KDR: {FFFFFF}%0.2f\t\t\t\t",infstr,Float:Player[playerid][Kills]/Float:Player[playerid][Deaths]); 
format(infstr,sizeof(infstr),"%s{FF6666}- {0ECEF0}Valoracion: {FFFFFF}%0.2f\t\t\t\t",infstr,Float:Player[playerid][DuelosGanados]/Float:Player[playerid][DuelosPerdidos]); 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)