Hallo Breadfish-User,
Ich schreibe gerade mein Script auf MySQL um und habe festgestellt, dass die Daten gar nicht gespeichert werden.
Habe beim Login bzw. nach der Registration des Spielers:
SetPVarInt(playerid,"Eingeloggt",1);
Bei OnPlayerDisConenct:
SavePlayer(playerid);
Und hier die Funktion SavePlayer:
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
mysql_SetInt("accounts", "Deaths", Player[playerid][Deaths], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Kills", Player[playerid][Kills], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Points", Player[playerid][Pkt], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Wantedlevel", Player[playerid][Wantedlevel], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Admin", Player[playerid][Admin], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Drugs", Player[playerid][Drugs], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Spawn", Player[playerid][spawnc], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "WantedVariable", Player[playerid][WVar], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "HausVariable", Player[playerid][HVar], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Shotgunskill", Player[playerid][Shotgun], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "SawnOff", Player[playerid][SawnOff], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Spas12", Player[playerid][Spas12], "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Premium", Player[playerid][VIP], "Name", Player[playerid][eName]);
mysql_SetString("accounts", "Rank", string_rank, "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Geld", GetPlayerMoney(playerid), "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Score", GetPlayerScore(playerid), "Name", Player[playerid][eName]);
mysql_SetInt("accounts", "Deaths", knastzeit[playerid], "Name", Player[playerid][eName]);
}
}
return 1;
}
Edit: Es steht immer nur der Wert "Null" in der Tabelle