Hallo!
Ich hab ein System gescriptet, welches Blinker erstellt, die sich der Auto Größe anpassen.
Nun werden die Blinker aber immer im "0-Punkt" des Autos attacht.
Wie kann man das beheben?
if(newkeys & KEY_LOOK_LEFT && IsPlayerInAnyVehicle(playerid) && InCar(playerid))
{
if(GetPVarInt(playerid, "BlinkerLinks") == -1)
{
new blinker1 = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
new blinker2 = CreateObject(19294, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
new Float:v_x, Float:v_y, Float:v_z;
GetVehicleModelInfo(GetPlayerVehicleID(playerid), VEHICLE_MODEL_INFO_SIZE, v_x, v_y, v_z);
new Float:v_ex = v_x/2;
new Float:v_ey = v_y/2;
new Float:z1;
GetVehicleModelInfo(GetPlayerVehicleID(playerid), VEHICLE_MODEL_INFO_REAR_BUMPER_Z, v_x, v_y, z1);
new Float:z2;
GetVehicleModelInfo(GetPlayerVehicleID(playerid), VEHICLE_MODEL_INFO_FRONT_BUMPER_Z, v_x, v_y, z2);
AttachObjectToVehicle(blinker1, GetPlayerVehicleID(playerid), -v_ex, -v_ey, z1, 0.0, 0.0, 0.0);
AttachObjectToVehicle(blinker2, GetPlayerVehicleID(playerid), -v_ex, v_ey, z2, 0.0, 0.0, 0.0);
SetPVarInt(playerid, "BlinkerLinks", blinker1);
SetPVarInt(playerid, "BlinkerLinks2", blinker2);
} else {
DestroyObject(GetPVarInt(playerid, "BlinkerLinks"));
DestroyObject(GetPVarInt(playerid, "BlinkerLinks2"));
SetPVarInt(playerid, "BlinkerLinks", -1);
SetPVarInt(playerid, "BlinkerLinks2", -1);
}
}