Hallo leute,
Ich hab ein login register aber nur wenn ich mich registriere gebomm ich start geld ein skin und level 1 So aber wenn ich neu rein komme hab ich kein geld skin 0 level 0 Kann mir mal einer helfen
Dialogs
#define DIALOG_LOGIN 1
#define DIALOG_REG 2
Der enum
enum SPDaten{ Admin, Level, Geschlecht, Muted, Money, Tut, MuteTime, DrivLic, Skin, Eingeloggt,}new Spieler[MAX_PLAYERS][SPDaten];
das andere
Bei onplayerconnect
Spieler[playerid][Eingeloggt] = 0; Spieler[playerid][Admin] = 0; Spieler[playerid][Level] = 0; Spieler[playerid][Money] = 0; Spieler[playerid][Muted] = 0; Spieler[playerid][MuteTime] = 0;
new name0; [MAX_PLAYER_NAME], accFormat[128];
GetPlayerName(playerid, name, sizeof(name)); format(accFormat, sizeof(accFormat), "/Accounts/%s.ini", name); if(dini_Exists(accFormat)) { SetTimerEx("LoginDialog", 3000, 0, "%i", playerid); } else { SetTimerEx("RegDialog", 3000, 0, "%i", playerid); } new name[MAX_PLAYER_NAME], accFormat[128], logstring[64]; GetPlayerName(playerid, name, sizeof(name)); format(accFormat, sizeof(accFormat), "/Accounts/%s.ini", name); if(response) { switch(dialogid) { case DIALOG_LOGIN: { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "German Reallife City", "Einloggen. Bitte gib dein Passwort ein:", "OK", " "); return 1; } if(strcmp(inputtext, dini_Get(accFormat,"Passwort")) == 0) { Spieler[playerid][Admin] = dini_Int(accFormat, "Admin"); Spieler[playerid][Level] = dini_Int(accFormat, "Level"); Spieler[playerid][Geschlecht] = dini_Int(accFormat, "Geschlecht"); Spieler[playerid][Money] = dini_Int(accFormat, "Money"); Spieler[playerid][Muted] = dini_Int(accFormat, "Muted"); Spieler[playerid][MuteTime] = dini_Int(accFormat, "MuteTime"); Spieler[playerid][DrivLic] = dini_Int(accFormat, "DrivLic"); if(Spieler[playerid][Muted] == 1) { if(Spieler[playerid][MuteTime] > 0) { mut[playerid] = SetTimerEx("UpdateMute", 60000*Spieler[playerid][MuteTime], 0, "%i",playerid); } if(Spieler[playerid][MuteTime] < 0) { Spieler[playerid][Muted] = 0; KillTimer(mut[playerid]); } } GameTextForPlayer(playerid, logstring, 3000, 1); SetSpawnInfo(playerid, 0,Spieler[playerid][Skin],0.0,0.0,200.0,0.0,0,0,0,0,0,0); SetPlayerPos(playerid,1462.9753,-1022.8845,23.8331); SpawnPlayer(playerid); } else { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "TEST", " Bitte gib dein Passwort ein:", "OK", " "); return 1; } } case DIALOG_REG: { if(!strlen(inputtext)) { ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "TEST", "Gib bitte dein Passwort ein:", "OK", " "); return SendClientMessage(playerid, COLOR_GRAD2, "Dein Passwort muss aus mindestens 6 Zeichen bestehen."); } if(strlen(inputtext) < 6) { ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "TEST", "gib bitte dein Passwort ein:", "OK", " "); return SendClientMessage(playerid, COLOR_GRAD2, "Dein Passwort muss aus mindestens 6 Zeichen bestehen."); } dini_Create(accFormat); dini_Set(accFormat, "Passwort", inputtext); Spieler[playerid][Eingeloggt] = 1; Spieler[playerid][Admin] = 0; Spieler[playerid][Level] = 1; Spieler[playerid][DrivLic] = 0; Spieler[playerid][Geschlecht] = 0; GivePlayerCash(playerid, 10000); Spieler[playerid][Muted] = 0; Spieler[playerid][MuteTime] = 0; SpawnPlayer(playerid); } } } else { switch(dialogid) { case DIALOG_LOGIN: ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "TEST", "Gib dein passwort ein", "OK", " "); case DIALOG_REG: ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "TEST", "Welches passwort willst du benutzen :", "OK", " "); } }
public LoginDialog(playerid)
{
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "TEST", "ein:", "OK", " ");
SetPlayerCameraPos(playerid,1418.3201,-1629.2102,54.6056);
SetPlayerCameraLookAt(playerid,1419.1599,-1630.1079,54.6056);
return 1;
}
public RegDialog(playerid)
{
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
SendClientMessage(playerid, COLOR_WEISS, "");
ShowPlayerDialog(playerid, DIALOG_REG, DIALOG_STYLE_PASSWORD, "<TEST", "Passwort ein:", "OK", " ");
SetPlayerCameraPos(playerid,1418.3201,-1629.2102,54.6056);
SetPlayerCameraLookAt(playerid,1419.1599,-1630.1079,54.6056);
return 1;
}