24.01.2014, 19:21
This should work tho
Change this
to this
Change this
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register on PBRP","Welcome to PBRP! This account is not registered.\nEnter your password below to create the account account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"PBRP User Database");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Money",0);
INI_WriteInt(File,"Level",0);
INI_WriteInt(File,"Skin",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SendClientMessage(playerid,-1,"Welcome to PBRP! You have successfully registered.");
}
else Kick(playerid);
}
else if(dialogid == DIALOG_LOGIN)
{
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SendClientMessage(playerid,-1,"Welcome back to PBRP! You have successfully logged in.");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login on PBRP","Welcome back to PBRP! This account is registered.\nEnter your password below to login to your account.","Login","Quit");
}
return 1;
}
else Kick(playerid);
}
return 1;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_REGISTER)
{
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_REGISTER,DIALOG_STYLE_INPUT,"Register on PBRP","Welcome to PBRP! This account is not registered.\nEnter your password below to create the account account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data"); //changed this back to data || Because your INI_ParseFile is "LoadUser_data"
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Money",0);
INI_WriteInt(File,"Level",0);
INI_WriteInt(File,"Skin",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
SendClientMessage(playerid,-1,"Welcome to PBRP! You have successfully registered.");
}
else Kick(playerid);
}
else if(dialogid == DIALOG_LOGIN)
{
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
SendClientMessage(playerid,-1,"Welcome back to PBRP! You have successfully logged in.");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login on PBRP","Welcome back to PBRP! This account is registered.\nEnter your password below to login to your account.","Login","Quit");
}
return 1;
}
else Kick(playerid);
}
return 1;
}