Jump to content
Guest francismori7

Air horn script

Recommended Posts

Guest tjhugentobler
airhorn.wav: Emergency 4\Mods\Los Angeles Mod v1.5\Audio\Fx\sirens

Create a new file in "Emergency 4\Mods\Los Angeles Mod v1.5\Scripts\Game\Command" named "LAHorn.script". Put this code in it:

int DummyGroup = 22;

object VcmdHorn : CommandScript
{
VcmdHorn()
{
SetIcon("sirens");
SetCursor("sirens");
SetRestrictions(RESTRICT_SELFEXECUTE);
SetPossibleCallers(ACTOR_VEHICLE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);
int hornsoundID;
Vector CarPos = v.GetPosition();
hornsoundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", CarPos, false);
//Audio::StopSample(hornsoundID);
}
};

object DummyHasSiren : CommandScript
{
DummyHasSiren()
{
SetGroupID(DummyGroup);
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
}
};

Add the command to all the cars you want it to in the editor. The command is "VcmdHorn".

PS: Everything is fixed and works perfectly.

Airhorn.wav uploaded:

Does this work for the LA Mod 1.6?? If it does, how do you do it?

Link to comment
Share on other sites

you fill the car with whatever you like, then you click rapid deploy, the first 4 in the vehicle, get hoses, once I had a whole team of paramedics put out a fire... of course, two got to close and burnt to a crisp :lol:

Oooo, I'm so trying that out in the next MP game...

Link to comment
Share on other sites

airhorn.wav: Emergency 4\Mods\Los Angeles Mod v1.5\Audio\Fx\sirens

Create a new file in "Emergency 4\Mods\Los Angeles Mod v1.5\Scripts\Game\Command" named "LAHorn.script". Put this code in it:

int DummyGroup = 22;

object VcmdHorn : CommandScript
{
VcmdHorn()
{
SetIcon("sirens");
SetCursor("sirens");
SetRestrictions(RESTRICT_SELFEXECUTE);
SetPossibleCallers(ACTOR_VEHICLE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);
int hornsoundID;
Vector CarPos = v.GetPosition();
hornsoundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", CarPos, false);
//Audio::StopSample(hornsoundID);
}
};

object DummyHasSiren : CommandScript
{
DummyHasSiren()
{
SetGroupID(DummyGroup);
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
}
};

Add the command to all the cars you want it to in the editor. The command is "VcmdHorn".

PS: Everything is fixed and works perfectly.

Airhorn.wav uploaded:

How do you create a new file?

Link to comment
Share on other sites

Guest NPD-Traffic

Very nice i was wondering is thee a way it the sound i chose for airhorn can repeat it self non stop until i shut it off. im going for dual tones :P i got a manaual electric sirens i wanted to add a EQ2b wail or Q siren for this new commando but it does stop automatically can anyone give me a pointer on how to.

Link to comment
Share on other sites

How do you create a new file?

Right click in windows, got to new, choose any file, i usually go with txt file, and rename it something.script and leave the txt part out. Then open it with whatever you use to edit script. I prefer a freeware app called notepad2.

Very nice i was wondering is thee a way it the sound i chose for airhorn can repeat it self non stop until i shut it off. im going for dual tones :P i got a manaual electric sirens i wanted to add a EQ2b wail or Q siren for this new commando but it does stop automatically can anyone give me a pointer on how to.

I would look at the autosiren script(that may not be the exact name but you get the idea) and change out the variables to point to your airhorn rather then the siren.

Not sure I explained that very well, but do you get the idea?

Link to comment
Share on other sites

Guest NPD-Traffic
Right click in windows, got to new, choose any file, i usually go with txt file, and rename it something.script and leave the txt part out. Then open it with whatever you use to edit script. I prefer a freeware app called notepad2.

I would look at the autosiren script(that may not be the exact name but you get the idea) and change out the variables to point to your airhorn rather then the siren.

Not sure I explained that very well, but do you get the idea?

So something like this



[left]
int DummyGroup = 22;

object VcmdHorn : CommandScript
{
VcmdHorn()
{
SetIcon("Dual");
SetCursor("Dual");
SetRestrictions(RESTRICT_SELFEXECUTE);
SetPossibleCallers(ACTOR_VEHICLE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Caller->RemoveCommand(CMD_Dual_ON);
Caller->AssignCommand(CMD_Dual_OFF);
}
};

object Vcmddualoff : CommandScript
{
Vcmddualoff()
{
SetIcon("Dual");
SetCursor("Dual");
SetGroupID(DummyGroup);
SetGroupLeader(true);
SetRestrictions(RESTRICT_SELFEXECUTE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return false;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Caller->RemoveCommand(CMD_dual_OFF);
Caller->AssignCommand(CMD_dual_ON);
}
};


object DummyHasSiren : CommandScript
{
DummyHasSiren()
{
SetGroupID(DummyGroup);
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
}
};

Im thinking im wrong but this is what i got when i mixed parts togeather:

I suck at scripting :P

Link to comment
Share on other sites

i did a little toying around.... heres a 30 second airhorn .wav tell me what u think please... or if u want something new let me know and i'll see what i can do also i added a dispatch i made for My fire department..... Positive Feed Back is welcome

airhorn.wav

LHFD_BOX_1_01_FIRE.wav

Link to comment
Share on other sites

Nice dispatch pearl. Any chance you could clear it up a bit? The voice is kind of toned out, or did you mean for that?

Thanks!

my voice is just that mono tone.... i'll give it another try though.... any requests? lol i can get some LA tones and just add my own dispatch....

requests are welcome

Link to comment
Share on other sites

Guest xxGTAPRO4LIFExx
airhorn.wav: Emergency 4\Mods\Los Angeles Mod v1.5\Audio\Fx\sirens

Create a new file in "Emergency 4\Mods\Los Angeles Mod v1.5\Scripts\Game\Command" named "LAHorn.script". Put this code in it:

int DummyGroup = 22;

object VcmdHorn : CommandScript
{
VcmdHorn()
{
SetIcon("sirens");
SetCursor("sirens");
SetRestrictions(RESTRICT_SELFEXECUTE);
SetPossibleCallers(ACTOR_VEHICLE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

return true;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);
int hornsoundID;
Vector CarPos = v.GetPosition();
hornsoundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", CarPos, false);
//Audio::StopSample(hornsoundID);
}
};

object DummyHasSiren : CommandScript
{
DummyHasSiren()
{
SetGroupID(DummyGroup);
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
return false;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
}
};

Add the command to all the cars you want it to in the editor. The command is "VcmdHorn".

PS: Everything is fixed and works perfectly.

Airhorn.wav uploaded:

Ok Ive gone to the editor and added the script, but how do I save it?

Link to comment
Share on other sites

could someone re upload the sounds for download as i cant download any of the files for the sounds already in this post!

And xxGTAPRO4LIFExx you cannot save it as ur em4 folder has the settings of Read only! u need to change tht by right clicking on Emergency4 folder click properties and then uncheck read only and click apply, tht u should solve ur problem, hope it helps!

Link to comment
Share on other sites

Guest xxGTAPRO4LIFExx
could someone re upload the sounds for download as i cant download any of the files for the sounds already in this post!

And xxGTAPRO4LIFExx you cannot save it as ur em4 folder has the settings of Read only! u need to change tht by right clicking on Emergency4 folder click properties and then uncheck read only and click apply, tht u should solve ur problem, hope it helps!

It didnt work, I dont think Im installing it right. Can someone send me their game files with it already installed?

could someone re upload the sounds for download as i cant download any of the files for the sounds already in this post!

And xxGTAPRO4LIFExx you cannot save it as ur em4 folder has the settings of Read only! u need to change tht by right clicking on Emergency4 folder click properties and then uncheck read only and click apply, tht u should solve ur problem, hope it helps!

Right Click and Save Target As

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...