Wieso löscht es die Sirene beim zweiten mal drücken nichtmehr? Die bleibt immer an.
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 528)
{
if(SSirene[GetPlayerVehicleID(playerid)] == 0)
{
DestroyObject(SSirene[GetPlayerVehicleID(playerid)]);
SSirene[GetPlayerVehicleID(playerid)] = CreateObject(19419,-0.0089111328, 0.273193359, 1.4037838, 0.0, 0.0, 96.0);
AttachObjectToVehicle(SSirene[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), -0.0089111328, -0.3, 1.05, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~b~Blaulicht Aktiviert",3000, 1);
SSirene[GetPlayerVehicleID(playerid)] = 1;
}
else if(SSirene[GetPlayerVehicleID(playerid)] == 1)
{
DestroyObject(528);
SSirene[GetPlayerVehicleID(playerid)] = CreateObject(19420,-0.0089111328, 0.273193359, 1.4037838, 0.0, 0.0, 96.0);
AttachObjectToVehicle(SSirene[GetPlayerVehicleID(playerid)], GetPlayerVehicleID(playerid), -0.0089111328, -0.3, 1.05, 0.0, 0.0, 0.0);
GameTextForPlayer(playerid,"~b~Blaulicht Deaktiviert",3000, 1);
SSirene[GetPlayerVehicleID(playerid)] = 0;
}
}
- Tomsen