Guten zusammen
Ich habe ein kleines Problem
wenn ich Offline gehe, und dann noch ein Spieler auf den Server ist, erhält er komischerweise meine gesammten daten
Warum auch immer
Ich bin Ratlos, da ich es Mit enums versucht habe und mit PVars
es kommt immer das selbe bei raus.
Den Player lass ich so laden:
stock LoadPlayerData(playerid)
{
mysql_reconnect();
new string[512],Get[100],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
format(string, 128, "SELECT * FROM player WHERE Name = '%s'",Name);
mysql_query(string);
mysql_store_result();
while(mysql_fetch_row_format(string,"|"))
{
mysql_fetch_field_row(Get, "Admin"); SetPVarInt(playerid,"Admin",strval(Get));
mysql_fetch_field_row(Get, "Job"); SetPVarInt(playerid,"Job",strval(Get));
mysql_fetch_field_row(Get, "Team"); SetPVarInt(playerid,"Team",strval(Get));
mysql_fetch_field_row(Get, "Skin"); SetPVarInt(playerid,"Skin",strval(Get));
mysql_fetch_field_row(Get, "Level"); SetPVarInt(playerid,"Level",strval(Get));
mysql_fetch_field_row(Get, "Job"); SetPVarInt(playerid,"Job",strval(Get));
mysql_fetch_field_row(Get, "Cash"); SetPVarInt(playerid,"Cash",strval(Get));
mysql_fetch_field_row(Get, "Respekt"); SetPVarInt(playerid,"Respekt",strval(Get));
mysql_fetch_field_row(Get, "PayDay"); SetPVarInt(playerid,"PayDay",strval(Get));
mysql_fetch_field_row(Get, "PayDayTog"); SetPVarInt(playerid,"PayDayTog",strval(Get));
mysql_fetch_field_row(Get, "Rank"); SetPVarInt(playerid,"Rank",strval(Get));
mysql_fetch_field_row(Get, "Leader"); SetPVarInt(playerid,"Leader",strval(Get));
mysql_fetch_field_row(Get, "Nummer"); SetPVarInt(playerid,"Nummer",strval(Get));
}
mysql_free_result();
format(string, 128,"%s%d",Name,0);
if(B_MySQL_CheckData("playercars","Name",string)!=0)
{
LoadPlayerCar(playerid,0);
}
format(string, 128,"%s%d",Name,1);
if(B_MySQL_CheckData("playercars","Name",string)!=0)
{
LoadPlayerCar(playerid,1);
}
format(string, 128,"%s%d",Name,2);
if(B_MySQL_CheckData("playercars","Name",string)!=0)
{
LoadPlayerCar(playerid,2);
}
}
Speichern lass ich den Spaß so
stock SavePlayer(playerid)
{
mysql_reconnect();
new Name[MAX_PLAYER_NAME],string[512];
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
format(string,512,"UPDATE `player` SET `Admin` = '%d',`Job` = '%d',`Team` = '%d',`Cash` = '%d',`Skin` = '%d',`Level` = '%d',`Respekt` = '%d',`PayDay` = '%d',`PayDayTog` = '%d',`Rank` = '%d',`Leader` = '%d',`Nummer` = '%d' WHERE `Name` = '%s'",
GetPVarInt(playerid,"Admin"),GetPVarInt(playerid,"Job"),GetPVarInt(playerid,"Team"),GetPlayerMoney(playerid),GetPlayerSkin(playerid),GetPVarInt(playerid,"Level"),GetPVarInt(playerid,"Respekt"),GetPVarInt(playerid,"PayDay"),
GetPVarInt(playerid,"PayDayTog"),GetPVarInt(playerid,"Rank"),GetPVarInt(playerid,"Leader"),GetPVarInt(playerid,"Nummer"),Name);
mysql_query(string);
return 1;
}
Wenn ich dann wieder onlinke komme, hab ich meine alten daten noch, aber Spieler 2 hat auch meine Daten.
Ratlos bin ich wirklich, da mir keine Lösung mehr dazu einfällt.
Daher hoffe ich auf eure hilfe