23.10.2012, 01:45
pawn Код:
if(dialogid == DIALOG_REGISTER)
{
if (!response) return Kick(playerid);
if(response)
{
new string[128], string2[128];
if(!strlen(inputtext)) return
format(string, sizeof(string), ""GM_NAME" Registration: (%s)", GetPlayerNameEx(playerid));
format(string2, sizeof(string2), "Error! Cannot create your account.\n\n%s, we cannot find this name registered in the database!\nPlease enter a password to register.", GetPlayerNameEx(playerid));
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, string, string2, "Register", "Close");
new INI:File = INI_Open(UserSavePath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 0);
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File, "Level",PlayerInfo[playerid][pLevel] = 0);
INI_WriteInt(File, "Admin",PlayerInfo[playerid][pAdmin] = 0);
INI_WriteInt(File, "Kills",PlayerInfo[playerid][pKills] = 0);
INI_WriteInt(File, "Deaths",PlayerInfo[playerid][pDeaths] = 0);
INI_WriteInt(File, "Ban",PlayerInfo[playerid][pBan] = 0);
SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have just registered, welcome to "GM_NAME"!");
SpawnPlayer(playerid);
}
}