05.08.2011, 14:49
PHP код:
if(dialogid == 2009)
{
if(response)
{
if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid, Red, "You are already logged in.");
if (udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, Orange, "This name is already taken.");
if (udb_Create(PlayerName(playerid),inputtext))
{
dUserSetINT(PlayerName(playerid)).("Score", 0);
dUserSetINT(PlayerName(playerid)).("AdminLevel", 0);
dUserSetINT(PlayerName(playerid)).("PlayerLevel", 0);
dUserSetINT(PlayerName(playerid)).("Kills", 0);
dUserSetINT(PlayerName(playerid)).("Deaths", 0);
return SendClientMessage(playerid, Red, "Your account has been created.");
}
}
if(!response)
{
SendClientMessage(playerid,Red,"Canceled");
}
return 1;
}
if(dialogid == 2010)
{
if(response)
{
if (PLAYERLIST_authed[playerid]) return SendClientMessage(playerid, Orange, "You are already logged in");
if (!udb_Exists(PlayerName(playerid))) return SendClientMessage(playerid, Orange, "That account is not yet registerd.");
if (udb_CheckLogin(PlayerName(playerid), inputtext))
{
SetPlayerScore(playerid, dUserINT(PlayerName(playerid)).("Score")-GetPlayerScore(playerid));
AdminLevel[playerid] = dUserINT(PlayerName(playerid)).("AdminLevel");
PlayerLevel[playerid] = dUserINT(PlayerName(playerid)).("PlayerLevel");
AdminLevel[playerid] = dUserINT(PlayerName(playerid)).("AdminLevel");
Deaths[playerid] = dUserINT(PlayerName(playerid)).("Deaths");
Kills[playerid] = dUserINT(PlayerName(playerid)).("Kills");
PLAYERLIST_authed[playerid]=true;
Logged[playerid] =1;
return SendClientMessage(playerid, Red, "You are now logged in.");
}
return SendClientMessage(playerid, Red, "Login Failed.");
}
if(!response)
{
SendClientMessage(playerid,Red,"Canceled");
}
return 1;
}