Small prob - 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: Small prob (
/showthread.php?tid=313885)
Small prob -
Face9000 - 27.01.2012
Hello,i've this warning:
warning 202: number of arguments does not match definition
In this code:
pawn Код:
for(new i=0;i<MAX_PLAYERS;i++)
{
new file[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
TotalRobberies = dini_Int(file, "Robberies", PlayerInfo[i][pRobberies]);
}
Is for show in /stats how much robberies has done the player.Is in OnGameModeInit,everything compiles fine,except that code.
Problem is in this line:
pawn Код:
TotalRobberies = dini_Int(file, "Robberies", PlayerInfo[i][pRobberies]);
Re: Small prob -
Kyosaur - 27.01.2012
Here is the declaration for dini_Int:
Код:
stock dini_Int(filename[],key[])
{
return strval(dini_Get(filename,key));
}
You're adding an extra parameter, and im not sure why as you already are assigning the return value to "TotalRobberies".
Re: Small prob -
Face9000 - 27.01.2012
Ok,i post the complete code.
Top of the script:
When a player finish to rob.
pawn Код:
new file[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), SERVER_USER_FILE, pname);
TotalRobberies++;
dini_IntSet(file, "Robberies", PlayerInfo[playerid][pRobberies]);
And the OnGameModeInit code that i posted.
Re: Small prob -
Kyosaur - 27.01.2012
Ok, you seem to not be understanding what i was trying to tell you. You're adding a parameter to dini_Int that you shouldnt be. dini_Int only accepts a filename and a key as parameters. There is no third parameter.
Try something like this:
Код:
PlayerInfo[i][pRobberies] = dini_Int(file, "Robberies");
TotalRobberies += PlayerInfo[i][pRobberies];
Re: Small prob -
Face9000 - 27.01.2012
Thank you,fixed.