Meaningless Compiling error -
_Khaled_ - 22.08.2012
So, check this out
pawn Код:
public OnPlayerConnect(playerid)
{
{
new pname[MAX_PLAYER_NAME], string[63 + MAX_PLAYER_NAME];
SendClientMessage(playerid,COLOR_GREEN,"Welcome to San Andreas ****");
SendClientMessage(playerid,COLOR_GREEN,"Make sure you read and abide by our /rules, and obey our admins.");
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{F81414}San Andreas **","{FFFFFF}Welcome, Type your password below to login.\nIf it's not you, relog with a different username","Login","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{F81414}San Andreas *******","{FFFFFF}Welcome, Type your password below to register a new account.","Register","Quit");
}
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has Joined the server.", pname);
SendClientMessageToAll(COLOR_CYAN, string);
return 1;
}
}
//==============================================================================
public OnPlayerDisconnect(playerid)
{
if(fexist(UserPath(playerid)))
{
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteInt(file,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(file,"Score",GetPlayerScore(playerid));
INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
INI_Close(file);
return 1;
}
}
Error:
Код:
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(102) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\SAMP\Server\gamemodes\****.pwn(102) : warning 215: expression has no effect
D:\SAMP\Server\gamemodes\****.pwn(102) : error 001: expected token: ";", but found "]"
D:\SAMP\Server\gamemodes\****.pwn(102) : error 029: invalid expression, assumed zero
D:\SAMP\Server\gamemodes\****.pwn(102) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
When I remove OnPlayerDisconnect, no compiling error.
Re: Meaningless Compiling error -
Kitten - 22.08.2012
Try
pawn Код:
public OnPlayerConnect(playerid)
{
new pname[MAX_PLAYER_NAME], string[63 + MAX_PLAYER_NAME];
SendClientMessage(playerid,COLOR_GREEN,"Welcome to San Andreas ****");
SendClientMessage(playerid,COLOR_GREEN,"Make sure you read and abide by our /rules, and obey our admins.");
if(fexist(UserPath(playerid))) {
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{F81414}San Andreas **","{FFFFFF}Welcome, Type your password below to login.\nIf it's not you, relog with a different username","Login","Quit");
}
else {
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{F81414}San Andreas *******","{FFFFFF}Welcome, Type your password below to register a new account.","Register","Quit");
}
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s has Joined the server.", pname);
SendClientMessageToAll(COLOR_CYAN, string);
return 1;
}
Re: Meaningless Compiling error -
_Khaled_ - 22.08.2012
The error is in OnPlayerDisconnect.
In Line 102
pawn Код:
public OnPlayerDisconnect(playerid)
{
if(fexist(UserPath(playerid)))
{
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file,"Player's Data");
INI_WriteInt(file,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(file,"Score",GetPlayerScore(playerid));
INI_WriteInt(file,"Kills",pInfo[playerid][Kills]); // (<<<<<<Line 102)
INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
INI_Close(file);
return 1;
}
Re: Meaningless Compiling error -
Kitten - 22.08.2012
You don't have pInfo defined.
i'd assume you can do something like this
pawn Код:
enum playerinfo
{
Kills,
Deaths,
Adminlevel
}
new pInfo[MAX_PLAYERS][playerinfo];
Re: Meaningless Compiling error -
_Khaled_ - 22.08.2012
it added my 4 Errors into 6.
Код:
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(63) : error 008: must be a constant expression; assumed zero
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(63) : error 021: symbol already defined: "pInfo"
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(103) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(103) : warning 215: expression has no effect
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(103) : error 001: expected token: ";", but found "]"
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(103) : error 029: invalid expression, assumed zero
D:\SAMP\Server\SACCNR [0.3e R2]\gamemodes\SACCNR.pwn(103) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
6 Errors.
Re: Meaningless Compiling error -
Kitten - 22.08.2012
Seems like you already got pInfo defined mind checking your enumerator if you have defined Kills,Deaths,Adminlevel on your own enumerator ?
Re: Meaningless Compiling error -
_Khaled_ - 22.08.2012
Okay hold on
Re: Meaningless Compiling error -
_Khaled_ - 22.08.2012
Compiling it crashes my pwn.
Re: Meaningless Compiling error -
Misiur - 22.08.2012
Show your pInfo initialization
Re: Meaningless Compiling error -
_Khaled_ - 22.08.2012
pawn Код:
//==============================================================================
enum pInfo
{
pPass,
pScore,
pCash,
pKills,
pDeaths,
pAdminLevel,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
//==============================================================================