11.05.2017, 23:52
PHP код:
enum pinfo
{
pTuto,
InTuto
};
new PlayerInfo[MAX_PLAYERS][pinfo];
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
new psswrdhashed[129];
whp_hash(psswrdhashed, sizeof(psswrdhashed), inputtext);
strdel(psswrdhashed, 127, 128);
if(strcmp(psswrdhashed, PlayerInfo[playerid][pPass]) == 0)
{
PlayerLogged[playerid] = true;
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pArgent]);
if(PlayerInfo[playerid][pTuto] == 0)
{
TimerTuto[playerid] = SetTimerEx("Tuto", 500, 0, "d", playerid);
PlayerInfo[playerid][InTuto] = 1;
}
if(PlayerInfo[playerid][pInscri] == 1)
{
TimerCreation[playerid] = SetTimerEx("Creation", 500, 0, "d", playerid);
}
SetSpawnInfo(playerid, 0, 0, PlayerInfo[playerid][lastx], PlayerInfo[playerid][lasty], PlayerInfo[playerid][lastz], 0, 0, 0, 0, 0, 0, 0);
SpawnPlayer(playerid);
return 1;
}
else
{
format(titlestring, sizeof(titlestring), "{3091DB}Erreur d'authentification!");
SafeDialogEx(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, titlestring, "\n{DD2D2D}[Erreur] {EE3A3A}Mot de passe incorrect, rйessayez.\n\n{B7B7B7}• Version Gamemode: {FFFFFF}RLRP v"SERVER_GM_TEXT".\n{B7B7B7}• Derniиre mise а jour: {FFFFFF}08/05/2017 - 19:57 (GMT+2).\n{B7B7B7}• Modifications effectuйes:{FFFFFF}\n "MOTD_LOGIN"", "Connexion","Quitter");
}
}
}
public OnPlayerDisconnect(playerid)
{
if(PlayerInfo[playerid][InTuto] == 1)
{
PlayerInfo[playerid][InTuto] = 0;
PlayerInfo[playerid][pTuto] = 0;
}
return 1;
}