04.12.2012, 05:35
this can help:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registeren...",""COL_RED"Je hebt een ongewenst wachtwoord in getypt\n"COL_WHITE"Type een wachtwoord om te registeren.","Registeeer","Dicht");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Wachtwoord",udb_hash(inputtext));
INI_WriteInt(File,"Geld",0);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Moorden",0);
INI_WriteInt(File,"Doden",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Bommen",0);
INI_WriteInt(File,"Rank",0);
INI_WriteInt(File,"K/D",0);
INI_WriteInt(File,"Vip",0);
INI_Close(File);
SetSpawnInfo(playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_WHITE"Succes!",""COL_GREEN" Kom terug om je stats te saven!","Ok","");
}
}
case DIALOG_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);
GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Succes!",""COL_GREEN"Je bent succesvol in gelogt.","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"Ongewenst wachtwoord in getypt.\n"COL_WHITE"Type de goed wachtwoord om in te loggen.","Login","Quit");
}
}
}
}
return 1;
}