SA-MP Forums Archive
pInfo problem (small one +rep) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: pInfo problem (small one +rep) (/showthread.php?tid=377803)



pInfo problem (small one +rep) - Twinklies - 15.09.2012

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




Re: pInfo problem (small one +rep) - RLGaming - 15.09.2012

Quote:

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

Missed the semi colon

Should work


Re: pInfo problem (small one +rep) - Twinklies - 15.09.2012

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.


Re: pInfo problem (small one +rep) - Cxnnor - 15.09.2012

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


Re: pInfo problem (small one +rep) - RLGaming - 15.09.2012

Have you defined the UserPath?

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


Re: pInfo problem (small one +rep) - Sig Hansen - 15.09.2012

NeverMind.


Re: pInfo problem (small one +rep) - gtakillerIV - 15.09.2012

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;
}



Re: pInfo problem (small one +rep) - Lordzy - 15.09.2012

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??


Re: pInfo problem (small one +rep) - gtakillerIV - 15.09.2012

Yea just saw it, stupid me *Face Palm*

Sorry.