09.12.2012, 17:38
pawn Код:
switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREY"Registering...",""COL_GREY"You have entered an invalid {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to register a new account.","Register","Quit");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Password",udb_hash(inputtext));
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"VIP",0);
INI_WriteInt(File,"DKZ",0);
INI_WriteInt(File,"Kills",0);
INI_WriteInt(File,"Deaths",0);
INI_WriteInt(File,"Jailed",0);
INI_WriteInt(File,"Muted",0);
INI_WriteInt(File,"Cash",0);
INI_WriteInt(File,"Score",0);
INI_WriteInt(File,"Banned",0);
INI_WriteInt(File,"Reputation",0);
INI_WriteInt(File,"PlayingHour",0);
INI_Close(File);
SendClientMessage(playerid, lightgreen, "[{B4B5B7}System{9ACD32}]: {B4B5B7}You have successfully register this account .");
SendClientMessage(playerid, lightgreen, "| {B4B5B7}Enjoy your stay! {9ACD32}|");
SendClientMessage(playerid, lightgreen, "| {B4B5B7}Follow the rules and Respect all player! {9ACD32}|");
}
}
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][pCash]);
ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_LGREEN"Success",""COL_LGREEN"You have successfully logged in!","Ok","");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_GREY"Login",""COL_GREY"You have entered an incorrect {FF6347}password{B4B5B7}.\n"COL_GREY"Type your password below to login.","Login","Quit");
}
SendClientMessage(playerid, lightgreen, "[{B4B5B7}System{9ACD32}]: {B4B5B7}You have successfully register this account .");
SendClientMessage(playerid, lightgreen, "| {B4B5B7}Enjoy your stay! {9ACD32}|");
SendClientMessage(playerid, lightgreen, "| {B4B5B7}Follow the rules and Respect all player! {9ACD32}|");
return 1;
}
}
}