Mein Vehicle id wird net gespeiert aber warum???
ihr der stock:
stock CreateCar(playerid, car[])
{
new query[1024],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
mysql_real_escape_string(Name,Name);
mysql_real_escape_string(car,car);
format(query, sizeof(query), "INSERT INTO `PrivatCars` (`Name`, `CarID`) VALUES ('%s', '%d')", Name, car);
mysql_query(query);
return true;
}
{
new query[1024],Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
mysql_real_escape_string(Name,Name);
mysql_real_escape_string(car,car);
format(query, sizeof(query), "INSERT INTO `PrivatCars` (`Name`, `CarID`) VALUES ('%s', '%d')", Name, car);
mysql_query(query);
return true;
}
und ihr die verwändung:
ocmd:buycar(playerid, params[])
{
for(new i=0; i<sizeof(SellCar); i++)
{
if(GetPlayerVehicleID(playerid)==SellCar[i][vehid])
{
new geld = SellCar[i][CarPreis];
if(GetPlayerMoney(playerid) >= geld)
{
GivePlayerMoney(playerid,-geld);
CreateVehicle(SellCar[i][Carid],742.2209,-1344.2977,13.2459,268.1639,-1,-1,60000);
PrivatCar[playerid][PrivatCarName] = SellCar[i][CarName];
PrivatCar[playerid][privatmodelid]= SellCar[i][Carid];//hir
PrivatCar[playerid][ParkX] = 742.2209;
PrivatCar[playerid][ParkY] = -1344.2977;
PrivatCar[playerid][ParkZ] = 13.2459;
PrivatCar[playerid][ParkA] = 268.1639;
SaveCar(playerid);
CreateCar(playerid,PrivatCar[playerid][privatmodelid]);// hir
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
}
else
{
SendClientMessage(playerid,Rot,"Du hast nicht genung Geld dabei!");
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}
{
for(new i=0; i<sizeof(SellCar); i++)
{
if(GetPlayerVehicleID(playerid)==SellCar[i][vehid])
{
new geld = SellCar[i][CarPreis];
if(GetPlayerMoney(playerid) >= geld)
{
GivePlayerMoney(playerid,-geld);
CreateVehicle(SellCar[i][Carid],742.2209,-1344.2977,13.2459,268.1639,-1,-1,60000);
PrivatCar[playerid][PrivatCarName] = SellCar[i][CarName];
PrivatCar[playerid][privatmodelid]= SellCar[i][Carid];//hir
PrivatCar[playerid][ParkX] = 742.2209;
PrivatCar[playerid][ParkY] = -1344.2977;
PrivatCar[playerid][ParkZ] = 13.2459;
PrivatCar[playerid][ParkA] = 268.1639;
SaveCar(playerid);
CreateCar(playerid,PrivatCar[playerid][privatmodelid]);// hir
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
}
else
{
SendClientMessage(playerid,Rot,"Du hast nicht genung Geld dabei!");
TogglePlayerControllable(playerid,1);
RemovePlayerFromVehicle(playerid);
}
}
}
return 1;
}