Stock problem, or maybe arguments problem
#1

Hello guys, I'm using Y_INI login/register system and decided to make /stats from it, so here's my script.

pawn Код:
CMD:stats(playerid,params[])
{
    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new score = GetPlayerScore(playerid);
    new cash = GetPlayerMoney(playerid);
    new kills = GetPlayerKills(playerid, name, Kills); //This line
    new deaths = GetPlayerDeaths(playerid, name, Deaths); //This line
    format(string,sizeof(string), "Name: %s\nCurrent ID: %d\nScore: %i\nCash: $%d\nKills: %i\nDeaths: %i", name, playerid, score, cash, kills, deaths);
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Your stats", string, "OK", "");
    return 1;
}

stock GetPlayerKills(playerid, name[], value[])
{
    INI_Int("Kills", pInfo[playerid][Kills]);
    return 1;
}

stock GetPlayerDeaths(playerid, name[], value[])
{
    INI_Int("Deaths", pInfo[playerid][Deaths]);
    return 1;
}
Код:
C:\Documents and Settings\User\Desktop\SAMP 0.3X Scripting\gamemodes\stuntproject.pwn(520) : error 035: argument type mismatch (argument 3)
C:\Documents and Settings\User\Desktop\SAMP 0.3X Scripting\gamemodes\stuntproject.pwn(521) : error 035: argument type mismatch (argument 3)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
How to fix it?
Reply
#2

Why to create stocks for such short codes?
pawn Код:
CMD:stats(playerid,params[])
{
    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new score = GetPlayerScore(playerid);
    new cash = GetPlayerMoney(playerid);
    new kills = INI_Int("Kills", pInfo[playerid][Kills]);
    new deaths = INI_Int("Deaths", pInfo[playerid][Deaths]);
    format(string,sizeof(string), "Name: %s\nCurrent ID: %d\nScore: %i\nCash: $%d\nKills: %i\nDeaths: %i", name, playerid, score, cash, kills, deaths);
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Your stats", string, "OK", "");
    return 1;
}
Reply
#3

Errors:
Код:
C:\Documents and Settings\User\Desktop\SAMP 0.3X Scripting\gamemodes\stuntproject.pwn(537) : error 029: invalid expression, assumed zero
C:\Documents and Settings\User\Desktop\SAMP 0.3X Scripting\gamemodes\stuntproject.pwn(537) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\User\Desktop\SAMP 0.3X Scripting\gamemodes\stuntproject.pwn(537) : error 017: undefined symbol "value"
C:\Documents and Settings\User\Desktop\SAMP 0.3X Scripting\gamemodes\stuntproject.pwn(537) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Those errors have nothing to do with the stats command I gave you. Look at the errors, what does "value" have to do with what I gave you?
Reply
#5

Put
pawn Код:
new value[128];
on the line with that error or above it. (Guessing it's on your stock)
Reply
#6

I think the value works with [Kills] and [Deaths]... I'm too new in Y_INI. :/
Reply
#7

Dude, remove all unnecessary codes. If you have doubts about which to remove, post code here.
Reply
#8

Why do I need to remove it? if I remove it, it only shows Name, Score and Cash.. I want Kills and Deaths in it. :/

I will give out +rep to who has helped me out!
Reply
#9

Ignore the stocks
pawn Код:
CMD:stats(playerid,params[])
{
    new string[256], name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new score = GetPlayerScore(playerid);
    new cash = GetPlayerMoney(playerid);
    new kills = pInfo[playerid][Kills]; //This line
    new deaths = pInfo[playerid][Deaths]; //This line
    format(string,sizeof(string), "Name: %s\nCurrent ID: %d\nScore: %i\nCash: $%d\nKills: %i\nDeaths: %i", name, playerid, score, cash, kills, deaths);
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Your stats", string, "OK", "");
    return 1;
}
Reply
#10

What's your current problem man? Where and why you use the variable "value"?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)