dialog problem
#1

PHP код:
CMD:stats(playerid,params[]) {
    new 
string[100], pDeathsplayer1hms,playername[MAX_PLAYER_NAME];
    if(
isnull(params)) player1 playerid;
     else 
player1 strval(params);
    if(
IsPlayerConnected(player1)) {
    new 
Float:xFloat:yFloat:zFloat:healthFloat:armor;
         
GetPlayerPos(playeridx,y,z); GetPlayerHealth(playeridhealth);
         
GetPlayerArmour(playeridarmor);
        
TotalGameTime(player1hms);
        
PlayerPlaySound(playerid11370.00.00.0);
        
GetPlayerName(player1playernamesizeof(playername));
         if(
PlayerInfo[player1][Deaths] == 0pDeaths 1; else pDeaths PlayerInfo[player1][Deaths];
        
format(stringsizeof(string), "| %s's Stats: \n Kills: %d \n Deaths: %d \n Ratio: %0.2f \n Money: $%d \n Time: %d \nhrs %d \nmins %d \nsecs %d\nScore: %d \n Health:%d \n Armour:%d",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), hmsGetPlayerScore(playerid), floatround(health),armor);
        
ShowPlayerDialog(playerid1112DIALOG_STYLE_MSGBOX,"STATS"string,"Close"); ////this line
    
} else return SendClientMessage(playeridred"Player Not Connected!");
    return 
1;

warning 202: number of arguments does not match definition
Reply
#2

Код:
ShowPlayerDialog(playerid, 1112, DIALOG_STYLE_MSGBOX,"STATS", string,"Close","");
ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
Reply
#3

bro the problem is .. dialog showing only first seven lines /
Reply
#4

PHP код:
string[100]

string[512
Reply
#5

PHP код:
CMD:stats(playerid,params[]) {
    new 
string[100], pDeathsplayer1hms,playername[MAX_PLAYER_NAME];
    if(
isnull(params)) player1 playerid;
     else 
player1 strval(params);
    if(
IsPlayerConnected(player1)) {
    new 
Float:xFloat:yFloat:zFloat:healthFloat:armor;
         
GetPlayerPos(playeridx,y,z); GetPlayerHealth(playeridhealth);
         
GetPlayerArmour(playeridarmor);
        
TotalGameTime(player1hms);
        
PlayerPlaySound(playerid11370.00.00.0);
        
GetPlayerName(player1playernamesizeof(playername));
         if(
PlayerInfo[player1][Deaths] == 0pDeaths 1; else pDeaths PlayerInfo[player1][Deaths];
          new 
string1[512];
        
format(string1sizeof(string1), "| %s's Stats: \n Kills: %d \n Deaths: %d \n Ratio: %0.2f \n Money: $%d \n Time: %d||| Hours: %d |||minutes: %d |||Seconds: %d\nScore: %s \n Health:%s \n Armour:%s",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), hmsGetPlayerScore(playerid), floatround(health),armor);
        
ShowPlayerDialog(playerid1112DIALOG_STYLE_MSGBOX,"STATS",stringstring1,"Close");
    } else return 
SendClientMessage(playeridred"Player Not Connected!");
    return 
1;

now compiled but when i do /stats
no response from command :P
Reply
#6

PHP код:
CMD:stats(playerid,params[]) { 
    new 
string[512], pDeathsplayer1hms,playername[MAX_PLAYER_NAME]; 
    if(
isnull(params)) player1 playerid
     else 
player1 strval(params); 

    if(
IsPlayerConnected(player1)) { 
    new 
Float:xFloat:yFloat:zFloat:healthFloat:armor
         
GetPlayerPos(playeridx,y,z); GetPlayerHealth(playeridhealth); 
         
GetPlayerArmour(playeridarmor); 
        
TotalGameTime(player1hms); 
        
PlayerPlaySound(playerid11370.00.00.0); 
        
GetPlayerName(player1playernamesizeof(playername)); 
         if(
PlayerInfo[player1][Deaths] == 0pDeaths 1; else pDeaths PlayerInfo[player1][Deaths]; 
        
format(stringsizeof(string), "| %s's Stats: \n Kills: %d \n Deaths: %d \n Ratio: %0.2f \n Money: $%d \n Time: %d \nhrs %d \nmins %d \nsecs %d\nScore: %d \n Health:%d \n Armour:%d",PlayerName2(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), hmsGetPlayerScore(playerid), floatround(health),armor); 
        
ShowPlayerDialog(playerid1112DIALOG_STYLE_MSGBOX,"STATS"string,"Close","");
    } else return 
SendClientMessage(playeridred"Player Not Connected!"); 
    return 
1

Reply
#7

thanks alot bro,,, +1 for u
can u tell plz,,what was wrong in my code? plz
Reply
#8

- The size of the string 512 and not 100
- You lost the last parameter ShowPlayerDialog

~ in the first post
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)