Small prob
#1

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]);
Reply
#2

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".
Reply
#3

Ok,i post the complete code.

Top of the script:

pawn Код:
new TotalRobberies;
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.
Reply
#4

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];
Reply
#5

Thank you,fixed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)