Hir leute wenn ich /savecarspawn mache dann Bekomme ich motorschaden
cod:
if(strcmp(cmd, "/savecarspawn", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid))
{
new pname[MAX_PLAYER_NAME];
new vehicleid = GetPlayerVehicleID(playerid);
new model = GetVehicleModel(vehicleid);
GetPlayerName(playerid, pname, sizeof(pname));
if(strcmp(CarInfo[vehicleid][cOwner], pname, true) == 0 || PlayerInfo[playerid][pAdmin]>=3)
{
new szString[80], Float:x, Float:y, Float:z, Float:angle;
GetVehiclePos(vehicleid, x,y,z);
GetVehicleZAngle(vehicleid, angle);
CarInfo[vehicleid][cModel] = model;
CarInfo[vehicleid][cX] = x;
CarInfo[vehicleid][cY] = y;
CarInfo[vehicleid][cZ] = z;
CarInfo[vehicleid][cAngle] = angle;
SaveCar(vehicleid);
format(szString, sizeof(szString), "Der Spawnpunkt für dieses Fahrzeug wurde geändert!");
SendClientMessage(playerid, COLOR_YELLOW, szString);
DestroyVehicle(vehicleid);
LoadCar(vehicleid);
CreateStreamVehicle(CarInfo[vehicleid][cModel], CarInfo[vehicleid][cX], CarInfo[vehicleid][cY], CarInfo[vehicleid][cZ], CarInfo[vehicleid][cAngle], CarInfo[vehicleid][cColor1], CarInfo[vehicleid][cColor2], -1);
SetVehicleNumberPlate(vehicleid, CarInfo[vehicleid][cKennzeichen]);
SetVehicleToRespawn(vehicleid);
}
else
{
SendClientMessage(playerid, COLOR_YELLOW, "Du bist nicht der Besitzer dieses Fahrzeuges!");
}
}
return 1;
}