SA-MP Forums Archive
Please help with: warning 202 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Please help with: warning 202 (/showthread.php?tid=303442)



Please help with: warning 202 - [DC] - 13.12.2011

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:




Re: Please help with: warning 202 - wildcookie007 - 13.12.2011

erm.. theres no such thing as DIALOG_SKILLINFO.


Re: Please help with: warning 202 - doreto - 13.12.2011

were are you OnDialogResponse ?


Respuesta: Re: Please help with: warning 202 - [DC] - 13.12.2011

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


Re: Please help with: warning 202 - Ballu Miaa - 13.12.2011

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


Respuesta: Please help with: warning 202 - [DC] - 13.12.2011

OK, thanks bro


Re: Please help with: warning 202 - Babul - 13.12.2011

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


Re: Respuesta: Please help with: warning 202 - Ballu Miaa - 13.12.2011

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]


Respuesta: Re: Please help with: warning 202 - [DC] - 13.12.2011

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!!!!


Re: Please help with: warning 202 - Ballu Miaa - 13.12.2011

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