Please help with: warning 202
#1

Please, help me with this warnings:

PHP код:
#if USE_STATS == true
dcmd_stats(playerid,params[])
{
    new 
pDeaths;
    new 
player1hms;
    if(!
strlen(params)) player1 playerid;
    else 
player1 strval(params);
    if(
IsPlayerConnected(player1))
    {
    
TotalGameTime(player1hms);
    if(
AccInfo[player1][Deaths] == 0pDeaths 1;
    else 
pDeaths AccInfo[player1][Deaths];
      return 
ShowPlayerDialog(playerid,DIALOG_SKILLINFO,DIALOG_STYLE_MSGBOX,"%s's Stats:","Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs","Ok","Cancel",PlayerName2(player1),AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), hms);
    } else
    return 
SendClientMessage(playeridred"Player Not Connected!");
}
#endif 
8 Warnings:
PHP код:
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition
(1314) : warning 202number of arguments does not match definition 
Line 1314:

PHP код:
return ShowPlayerDialog(playerid,DIALOG_SKILLINFO,DIALOG_STYLE_MSGBOX,"%s's Stats:","Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs","Ok","Cancel",PlayerName2(player1),AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), hms); 
It shows this:

Reply
#2

erm.. theres no such thing as DIALOG_SKILLINFO.
Reply
#3

were are you OnDialogResponse ?
Reply
#4

Quote:
Originally Posted by doreto
Посмотреть сообщение
were are you OnDialogResponse ?
No, im not OnDialogResponse
Reply
#5

You need to paste your OnPlayerDialogResponce as well as The Line 1314 for further help and information!
Reply
#6

OK, thanks bro
Reply
#7

replace
Код:
return ShowPlayerDialog(playerid,DIALOG_SKILLINFO,DIALOG_STYLE_MSGBOX,"%s's Stats:","Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs","Ok","Cancel",PlayerName2(player1),AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
by
Код:
new stringtitle[64];
new string[128];
format(stringtitle,sizeof(stringtitle),"%s's Stats:",PlayerName2(player1));
format(string,sizeof(string),"Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs",AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return ShowPlayerDialog(playerid,DIALOG_SKILLINFO,DIALOG_STYLE_MSGBOX,stringtitle,string,"Ok","Cancel",);
the problem with the amount of mismatching parameter warnings, obviously indicates the ShowPlayerDialog not used properly. you need to first format a string, then you may use it there. the formatting cant be done in the functions' parameters in realtime, thats all
Reply
#8

Quote:
Originally Posted by [DC]
Посмотреть сообщение
OK, thanks bro
EDIT: Replace what Babul told you too. The same code with line 1314 in your GM because you need to add format string for any pre defined function. [rep+ us if we helped you]
Reply
#9

Quote:
Originally Posted by Babul
Посмотреть сообщение
replace
Код:
return ShowPlayerDialog(playerid,DIALOG_SKILLINFO,DIALOG_STYLE_MSGBOX,"%s's Stats:","Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs","Ok","Cancel",PlayerName2(player1),AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
by
Код:
new stringtitle[64];
new string[128];
format(stringtitle,sizeof(stringtitle),"%s's Stats:",PlayerName2(player1));
format(string,sizeof(string),"Kills: [%d] | Deaths: [%d] | Ratio: [%0.2f] | Money: [$%d]\nTime: [%d] hrs [%d] mins [%d] secs",AccInfo[player1][Kills], AccInfo[player1][Deaths], Float:AccInfo[player1][Kills]/Float:pDeaths,GetPlayerMoney(player1), h, m, s);
return ShowPlayerDialog(playerid,DIALOG_SKILLINFO,DIALOG_STYLE_MSGBOX,stringtitle,string,"Ok","Cancel",);
the problem with the amount of mismatching parameter warnings, obviously indicates the ShowPlayerDialog not used properly. you need to first format a string, then you may use it there. the formatting cant be done in the functions' parameters in realtime, thats all
IT WORKED!!!!! THANKS VERY MUCH!!!!!!!!!!!!!!!!

THANKS TO ALL TOOOOOOOOO!!!!
Reply
#10

Yeah we know it will!! Click on the Star on our Tab to increase our rep! More for Babul!
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)