20.08.2011, 08:01
Heey guys,
I made my own INI saving system.
I watched on my server and saw that everybody was admin.
Whats wrong with this:
I made my own INI saving system.
I watched on my server and saw that everybody was admin.
Whats wrong with this:
Code:
enum pInfo
{
pAdmin
}
forward LoadUser_AccountData(playerid,name[],value[]);
public LoadUser_AccountData(playerid,name[],value[])
{
INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
return 1;
}
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
new plrIP[16];
INI_SetTag(File,"AccountData");
INI_WriteString(File,"Name",name);
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin",0);
INI_Close(File);
DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Great! Your Y_INI system works perfectly. Relog to save your stats!","Ok","");
}
}


