Hey community,
Ich suche mich jetzt schon tot, Ich habe ein Problem bei meinem Login/register system. Wenn ich mich registriere(ingame) erstellt er keine datei. Der Ordner name ist richtig.
Hier mal alles was zum register/Login system gehört:
public OnPlayerConnect(playerid)
{
new accFormat[128], pname[MAX_PLAYERS];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"/Accounts/%s.ini",pname);
if(fexist(accFormat))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Willkommen zurück,\nBitte logge dich ein","Weiter","Abbrechen");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Registrieren","Willkommen Fremder,\nBitte registriere dich","Weiter","Abbrechen");
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new accFormat[128], pname[MAX_PLAYERS];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"/Accounts/%s.ini",pname);
if(fexist(accFormat) && pInfo[playerid][Eingeloggt])
{
dini_IntSet(accFormat,"Skin",GetPlayerSkin(playerid));
dini_IntSet(accFormat,"Geld",GetPlayerMoney(playerid));
dini_IntSet(accFormat,"Wanted",GetPlayerWantedLevel(playerid));
dini_IntSet(accFormat,"Geschlecht",pInfo[playerid][Geschlecht]);
dini_IntSet(accFormat,"Alter",pInfo[playerid][Alter]);
dini_IntSet(accFormat,"Tutorial",pInfo[playerid][Tutorial]);
}
pInfo[playerid][Eingeloggt] = 0;
pInfo[playerid][Skin] = 0;
pInfo[playerid][Geld] = 0;
pInfo[playerid][Wanted] = 0;
pInfo[playerid][Geschlecht] = 0;
pInfo[playerid][Alter] = 0;
pInfo[playerid][Tutorial] = 0;
return 1;
}
public OnPlayerSpawn(playerid)
{
if(pInfo[playerid][Tutorial] == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"Es folgen ein paar Fragen und ein Tutorial");
return ShowPlayerDialog(playerid,DIALOG_GESCHLECHT,DIALOG_STYLE_MSGBOX,"Geschlecht","Bitte wähle dein Geschlecht","Männlich","Weiblich");
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
new accFormat[128], pname[MAX_PLAYERS];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"/Accounts/%s.ini",pname);
if(response)
{
switch(dialogid)
{
case DIALOG_LOGIN:
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Willkommen zurück,\nBitte logge dich ein","Weiter","Abbrechen");
return SendClientMessage(playerid,COLOR_RED,"Kein Passwort angegeben!");
}
if(strcmp(inputtext,dini_Get(accFormat,"Passwort")) == 0)
{
pInfo[playerid][Skin] = dini_Int(accFormat,"Skin");
pInfo[playerid][Geld] = dini_Int(accFormat,"Geld");
pInfo[playerid][Wanted] = dini_Int(accFormat,"Wanted");
pInfo[playerid][Geschlecht] = dini_Int(accFormat,"Geschlecht");
pInfo[playerid][Alter] = dini_Int(accFormat,"Alter");
pInfo[playerid][Tutorial] = dini_Int(accFormat,"Tutorial");
GivePlayerMoney(playerid,pInfo[playerid][Geld]);
SetPlayerWantedLevel(playerid,pInfo[playerid][Wanted]);
pInfo[playerid][Eingeloggt] = 1;
SendClientMessage(playerid,COLOR_GREY,"Erfolgreich eingeloggt");
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Willkommen zurück,\nBitte logge dich ein","Weiter","Abbrechen");
return SendClientMessage(playerid,COLOR_RED,"Falsches Passwort!");
}
}
case DIALOG_REGISTER:
{
if(!strlen(inputtext))
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Registrieren","Willkommen Fremder,\nBitte registriere dich","Weiter","Abbrechen");
return SendClientMessage(playerid,COLOR_RED,"Kein Passwort angegeben!");
}
dini_Create(accFormat);
dini_Set(accFormat,"Passwort",inputtext);
dini_IntSet(accFormat,"Geld",10000);
dini_IntSet(accFormat,"Tutorial",0);
pInfo[playerid][Eingeloggt] = 1;
}
}
}
else
{
switch(dialogid)
{
case DIALOG_LOGIN: ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Willkommen zurück,\nBitte logge dich ein","Weiter","Abbrechen");
case DIALOG_REGISTER: ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Registrieren","Willkommen Fremder,\nBitte registriere dich","Weiter","Abbrechen");
}
}
if(dialogid == DIALOG_GESCHLECHT)
{
if(response)
{
dini_IntSet(accFormat,"Geschlecht",1);
dini_IntSet(accFormat,"Skin",26);
SendClientMessage(playerid,COLOR_YELLOW,"Du bist also Männlich.");
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Alter","Bitte gib dein Geburtsdatum ein\n Format: dd.mm.yyyy","Weiter","Abbrechen");
}
else
{
dini_IntSet(accFormat,"Geschlecht",2);
dini_IntSet(accFormat,"Skin",40);
SendClientMessage(playerid,COLOR_YELLOW,"Du bist also Weiblich.");
ShowPlayerDialog(playerid,DIALOG_ALTER,DIALOG_STYLE_INPUT,"Alter","Bitte gib dein Geburtsdatum ein\n Format: dd.mm.yyyy","Weiter","Abbrechen");
}
}
if(dialogid == DIALOG_ALTER)
{
if(response)
{
new jahr, monat, tag, Datum[3][20], string[128];
getdate(jahr, monat,tag);
split(inputtext, Datum, '.');
new Age;
Age = jahr- strval(Datum[2]);
dini_IntSet(accFormat,"Alter",Age);
format(string,sizeof string,"Du bist also %d Jahre alt. Jetzt folgt das Tutorial",Age);
SendClientMessage(playerid,COLOR_YELLOW,string);
}
else
{
SendClientMessage(playerid,COLOR_YELLOW,"Du wurdest gekickt, weil du abbrechen gedrückt hast.");
Kick(playerid);
}
}
return 1;
}
Danke im vorraus, es wär total nett von euch wenn ihr mir helft
Ch4oS