Hi,
was ist hier falsch?
Es kommt keine fehlermeldung aber der Server-samp.exe scheißt immer ab wenn es Gamemode lädt.
public AddCar(model,Float:x,Float:y,Float:z,Float:angle,color1,color2,delay)
{
new FoundID = 0;
new cID;
new string[128];
new File:file;
if(model > 399 && model < 612)
{
for ( new i = 1; FoundID <= 0 ; i++)
{
format(string,sizeof(string),"/Vehicles/%d.ini",i);
if(!fexist(string))
{
cID = i;
FoundID = 1;
}
if( i > MAX_VEHICLES )
{
return 1;
}
}
format(string,sizeof(string),"/Vehicles/%d.ini",cID);
file = fopen(string,io_write);
new TextToWriteInFile[256];
format(TextToWriteInFile,sizeof TextToWriteInFile, "Model=%d\r\nVehicleX=%f\r\nVehicleY=%f\r\nVehicleZ=%f\r\nVehicleA=%f\r\nVehicleKM=%f\r\nVehicleKM2=%f\r\nVehicleTank=%f\r\nVehicleHealth=%f\r\nVehicleColor1=%d\r\nVehicleColor2=%d \r\nVehicleOwner=%s \r\nVehicleKey1%s \r\nVehicleNumberPlate=%s\r\nMotorschaden=%d \r\nVehicleID=%d \r\n",
VehicleInfo[cID][VehicleModel],
VehicleInfo[cID][VehicleX],
VehicleInfo[cID][VehicleY],
VehicleInfo[cID][VehicleZ],
VehicleInfo[cID][VehicleA],
VehicleInfo[cID][VehicleKM],
VehicleInfo[cID][VehicleKM2],
VehicleInfo[cID][VehicleTank],
VehicleInfo[cID][VehicleHealth],
VehicleInfo[cID][VehicleColor1],
VehicleInfo[cID][VehicleColor2],
VehicleInfo[cID][VehicleOwner],
VehicleInfo[cID][VehicleKey1],
VehicleInfo[cID][VehicleNumberPlate],
VehicleInfo[cID][Motorschaden],
VehicleInfo[cID][VehicleID]
);
fwrite(file, string);
fclose(file);
VehicleInfo[cID][VehicleModel] = model;
VehicleInfo[cID][VehicleX] = x;
VehicleInfo[cID][VehicleY] = y;
VehicleInfo[cID][VehicleZ] = z;
VehicleInfo[cID][VehicleA] = angle;
VehicleInfo[cID][VehicleColor1] = color1;
VehicleInfo[cID][VehicleColor2] = color2;
format(VehicleInfo[cID][VehicleOwner], MAX_PLAYER_NAME, "[NONE]");
}
else
{//Invalid Model
return 1;
}
return cID;
}
mfg