Hey,
wieso wird meine SpawnLocation nicht abgespeichert?
Ich speichere den genauso wie Kills usw. aber er speichert sich nicht ab. (Kills und so speichert der richtig ab.)
Also:
Hier wird die Location gesetted:
{
if(response)
{
if(listitem == 0)
{
CreateAccount(playerid,MD5_Hash(inputtext));
PlayerInfo[playerid][pSpawnLoc] = 1;
StopAudioStreamForPlayer(playerid);
SavePlayer(playerid);
return 1;
}
if(listitem == 1)
{
CreateAccount(playerid,MD5_Hash(inputtext));
PlayerInfo[playerid][pSpawnLoc] = 2;
StopAudioStreamForPlayer(playerid);
SavePlayer(playerid);
return 1;
}
if(listitem == 2)
{
CreateAccount(playerid,MD5_Hash(inputtext));
PlayerInfo[playerid][pSpawnLoc] = 3;
new rand = random(sizeof(LSCS));
SetSpawnInfo(playerid,0,101,LSCS[rand][SpawnX],LSCS[rand][SpawnY],LSCS[rand][SpawnZ],LSCS[rand][SpawnA],0,0,0,0,0,0);
SpawnPlayer(playerid);
StopAudioStreamForPlayer(playerid);
SavePlayer(playerid);
return 1;
}
if(listitem == 3)
{
CreateAccount(playerid,MD5_Hash(inputtext));
PlayerInfo[playerid][pSpawnLoc] = 4;
new rand = random(sizeof(LSDS));
SetSpawnInfo(playerid,0,101,LSDS[rand][SpawnX],LSDS[rand][SpawnY],LSDS[rand][SpawnZ],LSDS[rand][SpawnA],0,0,0,0,0,0);
SpawnPlayer(playerid);
StopAudioStreamForPlayer(playerid);
SavePlayer(playerid);
return 1;
}
SpawnPlayer(playerid);
}
return 1;
}
Ich habe nun es so gemacht, dass man eine Nachricht bekommt, wenn der Account erstellt/gespeichert/gesaved wird.
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
GivePlayerMoney(playerid,mysql_GetInt("accountsdm", "Geld", "Name", PlayerInfo[playerid][pName]));
SetPlayerScore(playerid, mysql_GetInt("accountsdm", "Level", "Name", PlayerInfo[playerid][pName]));
PlayerInfo[playerid][pKills] = mysql_GetInt("accountsdm","Morde","Name",PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pDeaths] = mysql_GetInt("accountsdm","Tode","Name",PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pAdmin] = mysql_GetInt("accountsdm","AdminLevel","Name",PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pSpawnLoc] = mysql_GetInt("accountsdm","SpawnLoc","Name",PlayerInfo[playerid][pName]);
SendClientMessage(playerid,bRot,"(( Deine Daten wurden geladen... ))");
formatEx(playerid,bRot,"LOADET DATA: Geld: %i, Level: %i, Morde: %i, Tode: %i, AdminLevel: %i, SpawnLoc: %i",GetPlayerMoney(playerid),GetPlayerScore(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSpawnLoc]);
}
return 1;
}
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
mysql_SetInt("accountsdm", "Geld", GetPlayerMoney(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accountsdm", "Level", GetPlayerScore(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accountsdm", "Morde", PlayerInfo[playerid][pKills], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accountsdm", "Tode", PlayerInfo[playerid][pDeaths], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accountsdm", "AdminLevel", PlayerInfo[playerid][pAdmin], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accountsdm", "SpawnLoc", PlayerInfo[playerid][pSpawnLoc], "Name", PlayerInfo[playerid][pName]);
SendClientMessage(playerid,bRot,"(( Deine Daten wurden abgespeichert... ))");
formatEx(playerid,bRot,"SAVED DATA: Geld: %i, Level: %i, Morde: %i, Tode: %i, AdminLevel: %i, SpawnLoc: %i",GetPlayerMoney(playerid),GetPlayerScore(playerid), PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pSpawnLoc]);
}
}
return 1;
}
{
new query[256],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
mysql_real_escape_string(Name,Name);
mysql_real_escape_string(pass,pass);
format(query, sizeof(query), "INSERT INTO `accountsdm` (`Name`, `Passwort`) VALUES ('%s', '%s')", Name, pass);
mysql_query(query);
formatEx(playerid,bRot,"CREATE ACCOUNT: Name: %s, Passwort: %s (MD5_Hashed)",Name,pass);
return true;
}
Wenn man sich registriert, wird der Acc erstellt und gespeichert. Jedoch wird die Speichernachricht nicht angezeigt. /psave Funktioniert dann auch nicht.
DIESE NACHRICHT WIRD ANGEZEIGT: CREATE ACCOUNT: ...
DIESE NACHRICHT WIRD ANGEZEIGT: LOADET DATA: ...
DIESE NACHRICHT WIRD NICHTANGEZEIGT: SAVED DATA: ...
//EDIT:Es hat irgendwas mit dem RegisterSystem zu tun.. Obwohl es komisch ist, denn jetzt habe ich unten alles ausgelesen, und der liest mir alles richtig aus.
if(listitem == 3)
{
PlayerInfo[playerid][pSpawnLoc] = 4;
new rand = random(sizeof(LSDS));
SetSpawnInfo(playerid,0,101,LSDS[rand][SpawnX],LSDS[rand][SpawnY],LSDS[rand][SpawnZ],LSDS[rand][SpawnA],0,0,0,0,0,0);
SpawnPlayer(playerid);
StopAudioStreamForPlayer(playerid);
SavePlayer(playerid);
formatEx(playerid,bRot,"Location: %i, Random: %i, X/Y/Z/A: %.2f %.2f %.2f",PlayerInfo[playerid][pSpawnLoc],rand,LSDS[rand][SpawnX],LSDS[rand][SpawnY],LSDS[rand][SpawnZ],LSDS[rand][SpawnA]);
return 1;
}
/e: Bitte Help! Bin am verzweifeln