Code
public OnVehicleSirenStateChange(playerid, vehicleid, newstate)
{
new VehicleID = GetPlayerVehicleID(playerid);
new fV = IsAFraktionsVeh(vehicleid);
if(IsAFraktionsVeh(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(GetVehicleModel(VehicleID) == 560 || fVehicle[fV][vehSiren] == 1 && fVehicle[fV][vehFraktion] == 5)
{
if(newstate)
{
FlashTime[vehicleid] = SetTimerEx("OnLightFlash", flashtime, true, "d", vehicleid);
fVehicle[fV][vehUCL] = CreateDynamicObject(19419,0,0,-1000,0,0,0,100);
AttachDynamicObjectToVehicle(fVehicle[fV][vehUCL], fVehicle[fV][vehID], 0.015000,0.000000,0.820000,0.000000,0.000000,0.000000);
GameTextForPlayer(playerid, "~w~Sirene ~g~an", 3000, 1);
}
if(!newstate)
{
new panels, tuer, licht, reifen;
KillTimer(FlashTime[vehicleid]);
GetVehicleDamageStatus(vehicleid, panels, tuer, licht, reifen);
UpdateVehicleDamageStatus(vehicleid, panels, tuer, 0, reifen);
DestroyDynamicObject(fVehicle[fV][vehUCL]);
GameTextForPlayer(playerid, "~w~Sirene ~r~aus", 3000, 1);
}
}
else if(GetVehicleModel(VehicleID) == 560 || fVehicle[fV][vehSiren] == 1 || fVehicle[fV][vehFraktion] == 2 || fVehicle[fV][vehFraktion] == 3 || fVehicle[fV][vehFraktion] == 4)
{
if(newstate)
{
FlashTime[vehicleid] = SetTimerEx("OnLightFlash", flashtime, true, "d", vehicleid);
SireneObject[VehicleID][0] = CreateDynamicObject(18646, 0, 0, -1000, 0, 0, 0, 100);
SireneObject[VehicleID][1] = CreateDynamicObject(19797, 0, 0, -1000, 0, 0, 0, 100);
SireneObject[VehicleID][2] = CreateDynamicObject(19797, 0, 0, -1000, 0, 0, 0, 100);
AttachDynamicObjectToVehicle(SireneObject[VehicleID][0], VehicleID, -0.544999,0.200000,0.859999,1.620000,-0.179999,0.000000);
AttachDynamicObjectToVehicle(SireneObject[VehicleID][1], VehicleID, 0.554999,-0.924999,0.665000,0.540000,-0.179999,0.000000);
AttachDynamicObjectToVehicle(SireneObject[VehicleID][2], VehicleID, -0.535000,-0.924999,0.665000,0.540000,-0.179999,0.000000);
GameTextForPlayer(playerid, "~w~Sirene ~g~an", 3000, 1);
}
if(!newstate)
{
new panels, tuer, licht, reifen;
KillTimer(FlashTime[vehicleid]);
GetVehicleDamageStatus(vehicleid, panels, tuer, licht, reifen);
UpdateVehicleDamageStatus(vehicleid, panels, tuer, 0, reifen);
DestroyDynamicObject(SireneObject[VehicleID][0]);
DestroyDynamicObject(SireneObject[VehicleID][1]);
DestroyDynamicObject(SireneObject[VehicleID][2]);
GameTextForPlayer(playerid, "~w~Sirene ~r~aus", 3000, 1);
}
}
}
return 1;
}
Alles anzeigen
Mal eine Kurze frage,
Warum kann ich die Sirene für LSPD nicht nutzen geschweige für SAMD?
vehSirene stimmt über ein das Fahrzeug und das es ein Fraktions Fahrzeug ist.