23.10.2012, 03:39
look, this is direct from my server, it works.
PHP код:
new pname[MAX_PLAYER_NAME];
new string[256];
new string2[256];
new id;
new Float:health;
new WantedLevel = GetPlayerWantedLevel(playerid);
switch(dialogid)
{
switch(dialogid)
{
case DIALOG_REGISTER:
{
if (!response)
{
return 1;
}
if(response)
{
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash] +1000000);
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"Player's Data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"AdminLevel",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Banned",0);
INI_Close(File);
}
}
}
switch(dialogid)
{
case DIALOG_LOGIN:
{
if (!response)
{
return 1;
}
if( response )
{
if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,"{F81414}","{FFFFFF}You have entered an incorrect password.\nPlease type your password below to login.\n\n{F81414}Please relog with a different username if that's not your account.","Login","Quit");
}
return 1;
}
}
}