Wieso werden meine Cars und so nicht abgespeichert? Ich werde nichtmal in die Tabelle ingetragen oO
Speichern
stock SavePCars(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
mysql_SetString("PrivatCars", "Name", GetName(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname1", PrivatCar[playerid][1][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname2", PrivatCar[playerid][2][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname3", PrivatCar[playerid][3][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname4", PrivatCar[playerid][4][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid1", PrivatCar[playerid][1][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid2", PrivatCar[playerid][2][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid3", PrivatCar[playerid][3][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid4", PrivatCar[playerid][4][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX1", PrivatCar[playerid][1][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX2", PrivatCar[playerid][2][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX3", PrivatCar[playerid][3][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX4", PrivatCar[playerid][4][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY1", PrivatCar[playerid][1][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY2", PrivatCar[playerid][2][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY3", PrivatCar[playerid][3][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY4", PrivatCar[playerid][4][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ1", PrivatCar[playerid][1][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ2", PrivatCar[playerid][2][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ3", PrivatCar[playerid][3][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ4", PrivatCar[playerid][4][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA1", PrivatCar[playerid][1][pcA], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA2", PrivatCar[playerid][2][pcA], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA3", PrivatCar[playerid][3][pcA], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA4", PrivatCar[playerid][4][pcA], "Name", PlayerInfo[playerid][pName]);
}
}
return 1;
}
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
if(GetPVarInt(playerid,"Eingeloggt") == 1)
{
mysql_SetString("PrivatCars", "Name", GetName(playerid), "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname1", PrivatCar[playerid][1][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname2", PrivatCar[playerid][2][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname3", PrivatCar[playerid][3][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetString("PrivatCars", "Autoname4", PrivatCar[playerid][4][CarName], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid1", PrivatCar[playerid][1][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid2", PrivatCar[playerid][2][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid3", PrivatCar[playerid][3][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetInt("PrivatCars", "modelid4", PrivatCar[playerid][4][modelid], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX1", PrivatCar[playerid][1][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX2", PrivatCar[playerid][2][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX3", PrivatCar[playerid][3][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarX4", PrivatCar[playerid][4][pcX], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY1", PrivatCar[playerid][1][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY2", PrivatCar[playerid][2][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY3", PrivatCar[playerid][3][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarY4", PrivatCar[playerid][4][pcY], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ1", PrivatCar[playerid][1][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ2", PrivatCar[playerid][2][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ3", PrivatCar[playerid][3][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarZ4", PrivatCar[playerid][4][pcZ], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA1", PrivatCar[playerid][1][pcA], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA2", PrivatCar[playerid][2][pcA], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA3", PrivatCar[playerid][3][pcA], "Name", PlayerInfo[playerid][pName]);
mysql_SetFloat("PrivatCars", "CarA4", PrivatCar[playerid][4][pcA], "Name", PlayerInfo[playerid][pName]);
}
}
return 1;
}
Laden:
stock LoadPCars(playerid)
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
PrivatCar[playerid][][PlayerName] = mysql_GetString("accounts","Name","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][CarName] = mysql_GetString("accounts","Autoname1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][CarName] = mysql_GetString("accounts","Autoname2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][CarName] = mysql_GetString("accounts","Autoname3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][CarName] = mysql_GetString("accounts","Autoname4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][modelid] = mysql_GetInt("accounts","modelid1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][modelid] = mysql_GetInt("accounts","modelid2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][modelid] = mysql_GetInt("accounts","modelid3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][modelid] = mysql_GetInt("accounts","modelid4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcX] = mysql_GetFloat("accounts","CarX1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcX] = mysql_GetFloat("accounts","CarX2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcX] = mysql_GetFloat("accounts","CarX3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcX] = mysql_GetFloat("accounts","CarX4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcY] = mysql_GetFloat("accounts","CarY1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcY] = mysql_GetFloat("accounts","CarY2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcY] = mysql_GetFloat("accounts","CarY3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcY] = mysql_GetFloat("accounts","CarY4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcZ] = mysql_GetFloat("accounts","CarZ1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcZ] = mysql_GetFloat("accounts","CarZ2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcZ] = mysql_GetFloat("accounts","CarZ3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcZ] = mysql_GetFloat("accounts","CarZ4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcA] = mysql_GetFloat("accounts","CarA1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcA] = mysql_GetFloat("accounts","CarA2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcA] = mysql_GetFloat("accounts","CarA3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcA] = mysql_GetFloat("accounts","CarA4","Name", PlayerInfo[playerid][pName]);
}
}
{
if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid))
{
PrivatCar[playerid][][PlayerName] = mysql_GetString("accounts","Name","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][CarName] = mysql_GetString("accounts","Autoname1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][CarName] = mysql_GetString("accounts","Autoname2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][CarName] = mysql_GetString("accounts","Autoname3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][CarName] = mysql_GetString("accounts","Autoname4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][modelid] = mysql_GetInt("accounts","modelid1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][modelid] = mysql_GetInt("accounts","modelid2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][modelid] = mysql_GetInt("accounts","modelid3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][modelid] = mysql_GetInt("accounts","modelid4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcX] = mysql_GetFloat("accounts","CarX1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcX] = mysql_GetFloat("accounts","CarX2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcX] = mysql_GetFloat("accounts","CarX3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcX] = mysql_GetFloat("accounts","CarX4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcY] = mysql_GetFloat("accounts","CarY1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcY] = mysql_GetFloat("accounts","CarY2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcY] = mysql_GetFloat("accounts","CarY3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcY] = mysql_GetFloat("accounts","CarY4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcZ] = mysql_GetFloat("accounts","CarZ1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcZ] = mysql_GetFloat("accounts","CarZ2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcZ] = mysql_GetFloat("accounts","CarZ3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcZ] = mysql_GetFloat("accounts","CarZ4","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][1][pcA] = mysql_GetFloat("accounts","CarA1","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][2][pcA] = mysql_GetFloat("accounts","CarA2","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][3][pcA] = mysql_GetFloat("accounts","CarA3","Name", PlayerInfo[playerid][pName]);
PrivatCar[playerid][4][pcA] = mysql_GetFloat("accounts","CarA4","Name", PlayerInfo[playerid][pName]);
}
}
Autokauf:
case DIALOG_AUTOKAUF:
{
if(response)
{
for(new i=0; i<sizeof(SellCar); i++)
{
if(GetPlayerVehicleID(playerid)==SellCar[i][vehid])
{
if(PrivatCar[playerid][CarKey[playerid]][HaveKey] > 0)
{
Fehler(playerid,"Für diesen Schlüssel besitzt du bereits ein Fahrzeug. Benutze /carkey");
return 1;
}
/*
CarName[64],
PlayerName[64],
modelid,
Float:pcX[4],
Float:pcY[4],
Float:pcZ[4],
Float:pcA[4]*/
new preis = SellCar[i][Preis];
GivePlayerMoney(playerid,-preis);
CreateVehicle(SellCar[i][modelid],553.5764,-1263.9396,16.9468,307.2815,1,1,60000);
PrivatCar[playerid][CarKey[playerid]][CarName] = SellCar[i][CarName];
PrivatCar[playerid][CarKey[playerid]][PlayerName] = GetName(playerid);
PrivatCar[playerid][CarKey[playerid]][modelid] = SellCar[playerid][modelid];
PrivatCar[playerid][CarKey[playerid]][pcX] = 553.5764;
PrivatCar[playerid][CarKey[playerid]][pcY] = -1263.9396;
PrivatCar[playerid][CarKey[playerid]][pcZ] = 16.9468;
PrivatCar[playerid][CarKey[playerid]][pcA] = 307.2815;
PrivatCar[playerid][CarKey[playerid]][HaveKey] = 1;
SavePCars(playerid);
RemovePlayerFromVehicle(playerid);
formatEx(playerid,Gelb,"Du hast dir erfolgreich für %i$ einen %s gekauft",preis,SellCar[i][CarName]);
return 1;
}
}
}
else
{
SendClientMessage(playerid,Grau,"Du hast den Kauf abgebrochen!");
RemovePlayerFromVehicle(playerid);
return 1;
}
return 1;
}
{
if(response)
{
for(new i=0; i<sizeof(SellCar); i++)
{
if(GetPlayerVehicleID(playerid)==SellCar[i][vehid])
{
if(PrivatCar[playerid][CarKey[playerid]][HaveKey] > 0)
{
Fehler(playerid,"Für diesen Schlüssel besitzt du bereits ein Fahrzeug. Benutze /carkey");
return 1;
}
/*
CarName[64],
PlayerName[64],
modelid,
Float:pcX[4],
Float:pcY[4],
Float:pcZ[4],
Float:pcA[4]*/
new preis = SellCar[i][Preis];
GivePlayerMoney(playerid,-preis);
CreateVehicle(SellCar[i][modelid],553.5764,-1263.9396,16.9468,307.2815,1,1,60000);
PrivatCar[playerid][CarKey[playerid]][CarName] = SellCar[i][CarName];
PrivatCar[playerid][CarKey[playerid]][PlayerName] = GetName(playerid);
PrivatCar[playerid][CarKey[playerid]][modelid] = SellCar[playerid][modelid];
PrivatCar[playerid][CarKey[playerid]][pcX] = 553.5764;
PrivatCar[playerid][CarKey[playerid]][pcY] = -1263.9396;
PrivatCar[playerid][CarKey[playerid]][pcZ] = 16.9468;
PrivatCar[playerid][CarKey[playerid]][pcA] = 307.2815;
PrivatCar[playerid][CarKey[playerid]][HaveKey] = 1;
SavePCars(playerid);
RemovePlayerFromVehicle(playerid);
formatEx(playerid,Gelb,"Du hast dir erfolgreich für %i$ einen %s gekauft",preis,SellCar[i][CarName]);
return 1;
}
}
}
else
{
SendClientMessage(playerid,Grau,"Du hast den Kauf abgebrochen!");
RemovePlayerFromVehicle(playerid);
return 1;
}
return 1;
}