Moin,
ich habe versucht in ein Modfahrzeug eine Sirene einzubauen. Als Vorlage für das Sirenenscript verwende ich ivory_data.
Meine config.cpp
class UserActions
{
class gyrophare
{
displayName="<t color='#0000ff'>Code 2</t>";
position="drivewheel";
radius=1000;
condition="driver this == player && (this animationPhase 'ani_lightbar' != 0.1)";
statement="this execVM '\gek_audi_a4_avant_police\scripts\gyrophares.sqf';";
onlyForplayer=0;
};
class gyrophare2
{
displayName="<t color='#ff0000'>Code 3</t>";
position="drivewheel";
radius=1000;
condition="driver this == player && (this animationPhase 'ani_lightbar' != 0.1)";
statement="this animate ['ani_siren', 1]; this execVM '\gek_audi_a4_avant_police\scripts\gyrophares2.sqf';"; // HIER
onlyForplayer=0;
};
class Warning
{
displayName="<t color='#ffff00'>Warnleuchten</t>";
position="drivewheel";
radius=1000;
condition="driver this == player && (this animationPhase 'ani_lightbar' != 0.1)";
statement="this execVM '\gek_audi_a4_avant_police\scripts\avertissement.sqf';";
onlyForplayer=0;
};
class WarningRight
{
displayName="<t color='#ffff00'>Warnleuchten Rechts</t>";
position="drivewheel";
radius=1000;
condition="driver this == player && (this animationPhase 'ani_lightbar' != 0.1)";
statement="this execVM '\gek_audi_a4_avant_police\scripts\avertissement_droite.sqf';";
onlyForplayer=0;
};
class WarningLeft
{
displayName="<t color='#ffff00'>Warnleuchten Links</t>";
position="drivewheel";
radius=1000;
condition="driver this == player && (this animationPhase 'ani_lightbar' != 0.1)";
statement="this execVM '\gek_audi_a4_avant_police\scripts\avertissement_gauche.sqf';";
onlyForplayer=0;
};
class flash
{
displayName="<t color='#ffff00'>Blinken</t>";
position="drivewheel";
radius=1000;
condition="driver this == player && (this animationPhase 'ani_lightbar' != 0.1)";
statement="this execVM '\gek_audi_a4_avant_police\scripts\flash.sqf';";
onlyForplayer=0;
};
};
Alles anzeigen
Hatte auch versucht das von Ivory in meine config.cpp zu übernehmen :
class AnimationSources: AnimationSources // HIER
{
class turn_left
{
source="user";
animPeriod=0.001;
initPhase=0;
};
class ani_siren: turn_left // HIER
{
};
};
Alles anzeigen
und
class CfgVehicles
{
class Car;
class Car_F: Car
{
class HitPoints
{
class HitLFWheel;
class HitLF2Wheel;
class HitRFWheel;
class HitRF2Wheel;
class HitBody;
class HitGlass1;
class HitGlass2;
class HitGlass3;
class HitGlass4;
};
class AnimationSources; // HIER
};
Alles anzeigen
Die Sirens.sqf :
Spoiler anzeigen
private["_car"];
_car = _this;
_wail = "";
_wailTime = "";
_yelp = "";
_yelpTime = "";
_wail = "ivory_ss2000_wail";
_wailTime = 5.18;
_yelp = "ivory_ss2000_yelp";
_yelpTime = 4.56;
while {alive _car} do {
if (!isNull driver _car && _car animationPhase "ani_siren" > 0 && getdammage _car < 0.7 ) then {
_phase = round(_car animationPhase "ani_siren");
switch (_phase) do {
case 1: {
_car say3D _wail;
sleep _wailTime;
};
case 2: {
_car say3D _yelp;
sleep _yelpTime;
};
};
} else {
waitUntil {sleep 2; (_car animationPhase "ani_siren" > 0 && getdammage _car < 0.7)};
};
};
Leider bekomme ich keine Scriptfehler etc. Der Sound wird einfach nicht abgespielt. Könnte mir da jemand ne Anleitung geben wie ich das genau mache ?