02.01.2014, 22:27
Salut j'utilise dini je m'enregistre je quitte le serv je reviens j'entre le mdp et la mot de passe invalide le code :
Dialog:
Enum :
OnPlayerConnect:
OnPlayerDisco:
Merci
Dialog:
PHP Code:
format(string, sizeof(string), "/Comptes/%s.ini", PlayerName(playerid));
switch(dialogid)
{
case DIALOG_ENRE:
{
if(!response)
{
Kick(playerid);
}
else
{
new spass = strlen(inputtext);
if(spass > 0)
{
GetPlayerIp(playerid,ip,sizeof(ip));
dini_Create(string);
dini_Set(string, "password", inputtext);
dini_Set(string, "Ip",ip);
dini_Set(string, "Pseudo",joueur);
dini_IntSet(string, "Score", 0);
dini_IntSet(string, "ban", 0);
dini_IntSet(string, "Jail", 0);
dini_IntSet(string, "Mute", 0);
dini_IntSet(string, "Freeze", 0);
}
else
{
ShowPlayerDialog(playerid, DIALOG_ENRE, DIALOG_STYLE_INPUT, "Enregistrement", "Entre un mot de passe:", "Valider", "Annuler");
}
}
}
case DIALOG_LOG:
{
if(!response)
{
Kick(playerid);
}
else
{
new spass = strlen(inputtext);
if(spass > 0)
{
new code[200];
format(code, sizeof(code), "%s", dini_Get(string, "password"));
if(strcmp(inputtext, code) == 0)
{
GetPlayerIp(playerid,ip,sizeof(ip));
dini_Set(string, "Ip",ip);
Info[playerid][logged] = 1;
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_INPUT, "Connexion", "Entre ton mot de passe:", "Valider", "Annuler");
}
}
{
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_INPUT, "Connexion", "Entre ton mot de passe:", "Valider", "Annuler");
}
}
}
}
return 1;
}
PHP Code:
enum Information
{
logged,
Ip,
Pseudo,
Score,
ban,
Jail,
Mute,
Freeze
}
new Info[MAX_PLAYERS][Information];
PHP Code:
if(!dini_Exists(string))
{
ShowPlayerDialog(playerid, DIALOG_ENRE, DIALOG_STYLE_INPUT, "Enregistrement", "Entre un mot de passe:", "Valider", "Annuler");
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOG, DIALOG_STYLE_INPUT, "Connexion", "Entre ton mot de passe:", "Valider", "Annuler");
}
PHP Code:
new ip[16],string[128];
GetPlayerIp(playerid,ip,sizeof(ip));
dini_Set(string, "Ip",ip);