Problem with my script.
#1

Somehow i'm getting these errors in my script:
EDIT] Now i have another problem.
Код:
C:\Users\Nelson.Paulo2301-PC\Desktop\Database.pwn(141) : error 017: undefined symbol "pScore"
C:\Users\Nelson.Paulo2301-PC\Desktop\Database.pwn(142) : error 035: argument type mismatch (argument 2)
Coded script:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/stats", true))
{
new string[500];
format(string,sizeof(string),"Password: %s | Money: %d | Deaths: %d | Kills: %d | Score: %d | Admin: %d ",PlayerInfo[playerid][pPass],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid,COL_GREEN,string);
        return 1;
}
    return 0;

}
Reply
#2

Bump, really need this resolved as fast as possible.
Reply
#3

[EDIT] Now i have another problem.
Код:
C:\Users\Nelson.Paulo2301-PC\Desktop\Database.pwn(141) : error 017: undefined symbol "pScore"
C:\Users\Nelson.Paulo2301-PC\Desktop\Database.pwn(142) : error 035: argument type mismatch (argument 2)
Coded script:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/stats", true))
{
new string[500];
format(string,sizeof(string),"Password: %s | Money: %d | Deaths: %d | Kills: %d | Score: %d | Admin: %d ",PlayerInfo[playerid][pPass],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid,COL_GREEN,string);
        return 1;
}
    return 0;

}
Reply
#4

Can you show us the "enum" of PlayerInfo? You probably forgot to add "pScore" in the enum.
Reply
#5

Yes, i can.

Код:
enum pInfo
{
    pPass,
    pCash,
	pScore,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPass]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Score",PlayerInfo[playerid][pScore]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    return 1;
}
Everything is here, any other suggestion?
Reply
#6

PHP код:
INI_Int("Password",PlayerInfo[playerid][pPass]); 
Why is the password an INT?
Also, why aren't you hashing their passwords..?
Reply
#7

I'm really new to scripting, just started some days ago, i'm downloading whirlpool to hash the password, in the mean while, how do i fix this?
Reply
#8

You must change from ` PlayerInfo[playerid][pScore] ` to ` GetPlayerScore(playerid) ` !

When the player connects , you will put in OnPlayerConnect:

SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);

Hope it helps!
Reply
#9

I'm having the same error.
Anyways, the line that is indicating the problem is
Код:
SendClientMessage(playerid,COL_GREEN,string);
But if i remove SendCLientMessage it works, but as everyone knows when you perform the command in-game it doesnt appear any kind of text, anyways:

Line: SendClientMessage(playerid,COL_GREEN,string);

Error: C:\Users\Nelson.Paulo2301-PC\Desktop\Database.pwn(145) : error 035: argument type mismatch (argument 2)

Full code:
http://pastebin.com/rxAZhvtr

Full command:
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/stats", true))
{
new string[500];
format(string,sizeof(string),"Password: %s | Money: %d | Deaths: %d | Kills: %d | Score: %d | Admin: %d ",PlayerInfo[playerid][pPass],PlayerInfo[playerid][pCash],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pAdmin]);
SendClientMessage(playerid,COL_GREEN,string);
        return 1;
}
    return 0;
 
}
Reply
#10

Quote:
Originally Posted by TheBoZ
Посмотреть сообщение
Like this?
Yeah, this should work.

EDIT: You forgot a parenthesis.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)