Hallo
In meinem Script sind natürlich verschiedene Autohäuser integriert
Ein Spieler kann dort ein Auto kaufen mit der NumPad Auswahl und Enter etc.
Geld wird auch abgezogen doch, dort spawnt kein Fahrzeug...
Bitte um Hilfe...
Function OnPlayerBuyCar(playerid,Model,Preis,Autohaus)//CARSYS
{
if(IsPlayerConnected(playerid) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
{
CallRemoteFunction("M_GivePlayerMoney","id",playerid,-Preis);
if(Autohaus == 0)
{
AddToBizzTill(0,Preis/2);
}
else if(Autohaus == 2)
{
AddToBizzTill(0,Preis);
}
else if(Autohaus == 3)
{
AddToBizzTill(0,Preis/2);
}
else if(Autohaus == 4)
{
AddToBizzTill(0,Preis/10);
}
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Herzlichen Glückwunsch");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Sie haben sich für ein sehr schönes Fahrzeug entschieden,");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Viel Spaß damit.");
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Dein Admin-Team.");
PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0);
SetParkPlatz(playerid,Autohaus);
new name[MAX_PLAYER_NAME], str[128], plate[8];
GetPlayerName(playerid, name, sizeof name);
if(strlen(name) > 8) {
strmid(plate, name, 0, 8);
} else {
format(plate, sizeof(plate), "%s", name);
}
format(str, sizeof str, "/Autos/%s%d.dtcar", name,Dtc_PlayerKey[playerid]);
new File: hFile = fopen(str, io_write);
if (hFile)
{
new var[32];
format(var, 32, "CarId=0\n");fwrite(hFile, var);
format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Dtc_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
format(var, 32, "CarFB=0\n");fwrite(hFile, var);
format(var, 32, "CarRB=0\n");fwrite(hFile, var);
format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
format(var, 32, "CarHood=0\n");fwrite(hFile, var);
format(var, 32, "CarVents=0\n");fwrite(hFile, var);
format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
format(var, 32, "Preis=%d\n",Preis);fwrite(hFile, var);
format(var, 32, "Plate=%s\n", plate);fwrite(hFile, var);
fclose(hFile);
}
OnPlayerCarLogin(playerid);
}