Hallo ich habe angefangen mit mysql und ja habe es so gemacht das ich wieder an die letzte pos spawn also er speichert es ab aber abrufen geht nicht spawne dann in der farm also die 0 achsen warum ?
public OnPlayerSpawn(playerid)
{
StopAudioStreamForPlayer(playerid);
SetPlayerPos(playerid,PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
}
stock LoadPlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
GetPlayerName(playerid, PlayerInfo[playerid][pName], MAX_PLAYER_NAME);
PlayerInfo[playerid][pLevel] = mysql_GetInt("accounts", "Level", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pGeschlecht] = mysql_GetInt("accounts", "Geschlecht", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pAlter] = mysql_GetInt("accounts", "Alter", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pGeld] = mysql_GetInt("accounts", "Geld", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pTut] = mysql_GetInt("accounts", "TuT", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pKills] = mysql_GetInt("accounts", "Kills", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pTode] = mysql_GetInt("accounts", "Tode", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pInt] = mysql_GetInt("accounts", "Interior", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pHealth] = mysql_GetInt("accounts", "Health", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pPos_x] = mysql_GetInt("accounts", "Pos_x", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pPos_y] = mysql_GetInt("accounts", "Pos_y", "Name", PlayerInfo[playerid][pName]);
PlayerInfo[playerid][pPos_z] = mysql_GetInt("accounts", "Pos_z", "Name", PlayerInfo[playerid][pName]);
}
return 1;
}
Also speichern geht aber abrufen nicht aber trotzden hier
stock SavePlayer(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
mysql_SetInt("accounts", "Level", PlayerInfo[playerid][pLevel], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Geschlecht", PlayerInfo[playerid][pGeschlecht], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Alter", PlayerInfo[playerid][pAlter], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Geld", PlayerInfo[playerid][pGeld], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "TuT", PlayerInfo[playerid][pTut], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Kills", PlayerInfo[playerid][pKills], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Tode", PlayerInfo[playerid][pTode], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("accounts", "Interior", PlayerInfo[playerid][pInt], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("accounts", "Health", PlayerInfo[playerid][pHealth], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("accounts", "Pos_x", PlayerInfo[playerid][pPos_x], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("accounts", "Pos_y", PlayerInfo[playerid][pPos_y], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("accounts", "Pos_z", PlayerInfo[playerid][pPos_z], "Name", PlayerInfo[playerid][pName]);
}
}
return 1;
}