Das ist die Login funktion wo ich den Player lade:
forward OnPasswortResponse(playerid);
public OnPasswortResponse(playerid)
{
new num_rows, num_fields;
cache_get_data(num_rows, num_fields, Handle);
if(num_rows)
{
//Passwort richtig
SpielerLaden(playerid);
SpawnPlayer(playerid);
}
else
{
//Passwort falsch
SendClientMessage(playerid, -1, "Das eingegebene Passwort ist falsch!");
new str[145], name[MAX_PLAYER_NAME], ip[16];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
GetPlayerIp(playerid, ip, sizeof(ip));
format(str, sizeof(str), ""#HTML_GELB"Hallo %s \n"#HTML_WEIS"Dein Account wurde gefunden! \nBitte gib nun dein Passwort ein \n Deine IP: "#HTM_GELB"%s", name, ip);
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,""ServerTag"Login",str ,"Login","Abbrechen");
}
return 1;
}
Alles anzeigen
@Jeffrydas Problem ist, dass es gar nicht gespeichert wird
Und so lade ich mein Spieler:
stock SpielerLaden(playerid)
{
sInfo[playerid][pID] = cache_get_field_content_int(0, "id", Handle);
sInfo[playerid][pEingeloggt] = 1;
sInfo[playerid][pAge] = cache_get_field_content_int(0,"Age",Handle);
sInfo[playerid][pSex] = cache_get_field_content_int(0,"Geschlecht",Handle);
sInfo[playerid][pAdminLevel] = cache_get_field_content_int(0,"AdminLevel",Handle);
sInfo[playerid][pMapper] = cache_get_field_content_int(0,"Mapper",Handle);
sInfo[playerid][pScripter] = cache_get_field_content_int(0,"Scripter",Handle);
sInfo[playerid][pPremium] = cache_get_field_content_int(0,"Premium",Handle);
sInfo[playerid][pLevel] = cache_get_field_content_int(0,"Level",Handle);
SetPlayerScore(playerid, sInfo[playerid][pLevel]);
sInfo[playerid][pRespektpunkte] = cache_get_field_content_int(0,"Respektpunkte",Handle);
sInfo[playerid][pBarGeld] = cache_get_field_content_int(0,"BarGeld",Handle);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, sInfo[playerid][pBarGeld]);
sInfo[playerid][pBankKonto] = cache_get_field_content_int(0,"BankKonto",Handle);
sInfo[playerid][pBankGeld] = cache_get_field_content_int(0,"BankGeld",Handle);
sInfo[playerid][pSkin] = cache_get_field_content_int(0,"Skin",Handle);
SetPlayerSkin(playerid, sInfo[playerid][pSkin]);
sInfo[playerid][pFraktion] = cache_get_field_content_int(0,"Fraktion",Handle);
sInfo[playerid][pFraktionRang] = cache_get_field_content_int(0,"FraktionRang",Handle);
sInfo[playerid][pSpawn] = cache_get_field_content_int(0,"Spawn",Handle);
sInfo[playerid][pHandy] = cache_get_field_content_int(0,"Handy",Handle);
sInfo[playerid][pHandynummer] = cache_get_field_content_int(0,"Handynummer",Handle);
sInfo[playerid][pPayDay] = cache_get_field_content_int(0,"PayDay",Handle);
sInfo[playerid][pSpielzeit] = cache_get_field_content_int(0,"Spielzeit",Handle);
sInfo[playerid][pJail] = cache_get_field_content_int(0,"Jail",Handle);
sInfo[playerid][pJailTime] = cache_get_field_content_int(0,"JailTime",Handle);
sInfo[playerid][pPrison] = cache_get_field_content_int(0,"Prison",Handle);
sInfo[playerid][pPrisonCheckpoints] = cache_get_field_content_int(0,"PrisonCheckpoints",Handle);
return 1;
}
Alles anzeigen