[data] Cash = 0 Score = 0 Kills = 0 Password = 0 Deaths = 0 RectionTests = 0 Moneybags = 0 Warned = 0 Kicked = 0 Banned = 0
enum pInfo { pPass, pAdmin, pScore, pCash, pKills, pDeaths, pReactionTests, pMoneyBags, pWarned, pKicked, pBanned } 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("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Score",PlayerInfo[playerid][pScore]); INI_Int("Cash",PlayerInfo[playerid][pCash]); INI_Int("Kills",PlayerInfo[playerid][pKills]); INI_Int("Deaths",PlayerInfo[playerid][pDeaths]); INI_Int("ReactionTests",PlayerInfo[playerid][pReactionTests]); INI_Int("MoneyBags",PlayerInfo[playerid][pMoneyBags]); INI_Int("Warned",PlayerInfo[playerid][pWarned]); INI_Int("Kicked",PlayerInfo[playerid][pKicked]); INI_Int("Banned",PlayerInfo[playerid][pBanned]); return 1; } public OnPlayerConnect(playerid) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit"); //Line 522 } return 1; } 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,"Score",PlayerInfo[playerid][pScore]); INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]); INI_WriteInt(File,"Password",PlayerInfo[playerid][pPass]); INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]); INI_WriteInt(File,"RectionTests",PlayerInfo[playerid][pReactionTests]); INI_WriteInt(File,"Moneybags",PlayerInfo[playerid][pMoneyBags]); INI_WriteInt(File,"Warned",PlayerInfo[playerid][pWarned]); INI_WriteInt(File,"Kicked",PlayerInfo[playerid][pKicked]); INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]); INI_Close(File); return 1; }
public OnPlayerConnect(playerid)
{
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit"); //Line 522
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_Int("Password",PlayerInfo[playerid][pPass]);
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
INI_Int("Kills",PlayerInfo[playerid][pKills]);
INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
INI_Int("RectionTests",PlayerInfo[playerid][pReactionTests]);
INI_Int("Moneybags",PlayerInfo[playerid][pMoneyBags]);
INI_Int("Warned",PlayerInfo[playerid][pWarned]);
INI_Int("Kicked",PlayerInfo[playerid][pKicked]);
INI_Int("Banned",PlayerInfo[playerid][pBanned]);
INI_Close(File);
return 1;
}
If you didn't notice, you are using DIALOG_REGISTER twice here:
pawn Код:
Also, the order of loaduser_data isn't the same as in onplayerdisconnect. So I will give you the correct OnPlayerDisconnect: pawn Код:
Reminder: You have 2 DIALOG_REGISTER dialogs in your OnPlayerConnect, put a DIALOG_LOGIN dialog in it.. If all this didn't work, give me your OnDialogResponse code. |
C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(544) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(544) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(545) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(545) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(546) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(546) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(547) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(547) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(548) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(548) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(549) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(549) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(550) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(550) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(551) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(551) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(552) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(552) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(553) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(553) : error 017: undefined symbol "value" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(554) : error 017: undefined symbol "name" C:\Users\Mohamed\Desktop\samp servering\gamemodes\grandlarc.pwn(554) : error 017: undefined symbol "value" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 22 Errors.
public OnPlayerConnect(playerid) { if(fexist(UserPath(playerid))) { INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{FFFFFF}Logging in.......","{FFFFFF}This account is regsitered. Type your password below","Login","Quit"); } else { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,"{FFFFFF}Registering...","{FFFFFF}Type your password below to register a new account.","Register","Quit"); //Line 522 } return 1; } public OnPlayerDisconnect(playerid, reason) { new INI:File = INI_Open(UserPath(playerid)); INI_SetTag(File,"data"); INI_Int("Password",PlayerInfo[playerid][pPass]); INI_Int("Admin",PlayerInfo[playerid][pAdmin]); INI_Int("Score",PlayerInfo[playerid][pScore]); INI_Int("Cash",PlayerInfo[playerid][pCash]); INI_Int("Kills",PlayerInfo[playerid][pKills]); INI_Int("Deaths",PlayerInfo[playerid][pDeaths]); INI_Int("RectionTests",PlayerInfo[playerid][pReactionTests]); INI_Int("Moneybags",PlayerInfo[playerid][pMoneyBags]); INI_Int("Warned",PlayerInfo[playerid][pWarned]); INI_Int("Kicked",PlayerInfo[playerid][pKicked]); INI_Int("Banned",PlayerInfo[playerid][pBanned]); INI_Close(File); return 1; }
You are loading the data when the player disconnects. That's wrong!
|