21.11.2011, 18:57
hi i have a problem...register/login dialogs work only for id 0..idk whats the problem,tell me what part of script i need to post so you can see whats the problem...please help
switch(dialogid)
{
case REGISTER:
{
if(!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT, "{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Online",0);
INI_WriteInt(File,"Locked",0);
INI_WriteInt(File,"SaveSkin",0);
INI_Close(File);
}
}
case LOGIN:
{
if(!response) return Kick(playerid);
if(response)
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
OnPlayerLogin(playerid);
}
else
{
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"{B0B0B0}Login",""RED"You have entered an incorrect password.\n{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
}
return 1;
}
}
}
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"{B0B0B0}Login","{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT,"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
}
if(!fexist(UserPath(playerid))) ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT,"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
else ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"{B0B0B0}Login","{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, LOGIN, DIALOG_STYLE_INPUT,"{B0B0B0}Login","{FFFFFF}Welcome back to {33E82A}San Andreas Stunt Evolution.{FFFFFF}\n\nThis account is already registered.Login to access your account:","Login","Cancel");
}
else
{
ShowPlayerDialog(playerid, REGISTER, DIALOG_STYLE_INPUT,"{B0B0B0}Register","{FFFFFF}Type your password below to register a new account.","Register","Cancel");
}