Hallo ich habe ein Problem ich bin noch am Anfangsbasis von Pawno und komme nicht weiter.
Ich habe ein Login und Register script.
Nun wenn man auf den Server joint meldet man sich neu an der speichert auch alles ab.
Nur das Problem ist wenn man erneut auf den Server joint muss man sich noch mal neu anmelden.
Hier mal der Script:
public OnPlayerConnect(playerid)
{
new PlayerName[MAX_PLAYER_NAME];
PlayerLogged[playerid] = 0;
new file[256];
format(file, sizeof(file), SERVER_USER_FILE, PlayerName);
if (!dini_Exists(file)) return ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registrieren", "Willkommen auf German-HyperReallife, bitte wähle dein Passwort", "Register", "Abbrechen");
if(fexist(file)) {
new plrIP[64];
GetPlayerIp(playerid, plrIP, 64);
if (PlayerInfo[playerid][IP] == GetPlayerIp(playerid, plrIP, 64)) {
PlayerInfo[playerid][RegisterDate] = dini_Int(file, "RegisterDate");
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
PlayerInfo[playerid][VIPLevel] = dini_Int(file, "VIPLevel");
PlayerInfo[playerid][Cash] = dini_Int(file, "Money");
PlayerInfo[playerid][Score] = dini_Int(file, "Score");
PlayerInfo[playerid][Skin] = dini_Int(file, "Skin");
PlayerInfo[playerid][Kills] = dini_Int(file, "Kills");
PlayerInfo[playerid][Deaths] = dini_Int(file, "Deaths");
PlayerInfo[playerid][IP] = dini_Int(file, "IP");
PlayerInfo[playerid][Banned] = dini_Int(file, "Banned");
PlayerInfo[playerid][Seconds] = dini_Int(file, "Seconds");
PlayerInfo[playerid][Minutes] = dini_Int(file, "Minutes");
PlayerInfo[playerid][Hours] = dini_Int(file, "Hours");
PlayerLogged[playerid] = 1;
GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
SetPlayerScore(playerid, PlayerInfo[playerid][Score]);
SendClientMessage(playerid, 0xB1FB44FF, "Auto-IP Loginned.");
static R, G, B;
SetPlayerColor(playerid, random((R * 16777216)) + random((G * 65536)) + random((B*256)));
if(GetPlayerColor(playerid) == COLOR_YELLOW) {
if(PlayerInfo[playerid][AdminLevel] == 0) {
SetPlayerColor(playerid, random((R * 16777216)) + random((G * 65536)) + random((B*256)));
}
}
if (PlayerInfo[playerid][Banned] == 1) {
SendClientMessage(playerid, 0xFF444499, "Du bist auf dem Server Gebannt, denk darüber nach!");
Kick(playerid);
}
}
else {
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Anmelden", "Willkommen zurück, melde dich bitte an", "Anmelden", "Abbrechen");
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}