pInfo problem (small one +rep)
#1

I have problem with PlayerInfo... Even I made it etc, it's still not reconizing it....
Code:
Quote:

enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];

Error lines:
Quote:

public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)) ;
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_Close(File);
return 1;
}

Errors:
Quote:

D:\Igre\SAMP Serveri\0.3c\gamemodes\ProScript.pwn(75) : error 017: undefined symbol "PlayerInfo"
D:\Igre\SAMP Serveri\0.3c\gamemodes\ProScript.pwn(75) : warning 215: expression has no effect
D:\Igre\SAMP Serveri\0.3c\gamemodes\ProScript.pwn(75) : error 001: expected token: ";", but found "]"
D:\Igre\SAMP Serveri\0.3c\gamemodes\ProScript.pwn(75) : error 029: invalid expression, assumed zero
D:\Igre\SAMP Serveri\0.3c\gamemodes\ProScript.pwn(75) : fatal error 107: too many error messages on one line

Reply
#2

Quote:

enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths
};

Missed the semi colon

Should work
Reply
#3

Quote:
Originally Posted by RLGaming
Посмотреть сообщение
Missed the semi colon

Should work
With or without it, I am still receiving same error.

Edit: resolved. The problem was I putted in before the #else.... :/ Thanks anyway.
Reply
#4

pawn Код:
enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths
}
new PlayerInfo[MAX_PLAYERS][pInfo];
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"data");
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
    INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
    INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Close(File);
    return 1;
}
Compiled and tested, I just copied and pasted from my script :3
Reply
#5

Have you defined the UserPath?

As in:
#define UserPath "/Users/%s.ini"
Reply
#6

NeverMind.
Reply
#7

Try to put your enum under OngameModeInt not inside it, if you already did that then I recommend you to check Kush's tutorial and don't just copy and paste everything better to understand not to copy and paste

https://sampforum.blast.hk/showthread.php?tid=273088

Anyways not sure if in your script you got spaces :-

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

Код:
public OnPlayerDisconnect(playerid, reason)
{
   new INI:File = INI_Open(UserPath(playerid));
   INI_SetTag(File,"data");
   INI_WriteInt(File,"Cash",GetPlayerMoney(playerid)) ;
   INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
   INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
   INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
   INI_Close(File);
   return 1;
}
Reply
#8

Quote:
Originally Posted by Twinklies
Посмотреть сообщение
With or without it, I am still receiving same error.

Edit: resolved. The problem was I putted in before the #else.... :/ Thanks anyway.
Guys did you see that the probelm is solved??
Reply
#9

Yea just saw it, stupid me *Face Palm*

Sorry.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)