Jump to content
Guest francismori7

Air horn script

Recommended Posts

Guest [SAP]Francis

There you go, GTAPRO.

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

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

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);
}
};

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".

Airhorn.wav uploaded:

http://jump.fm/LLHYH

Link to comment
Share on other sites

Guest xxGTAPRO4LIFExx

There you go, GTAPRO.

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

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

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);
}
};

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".

Airhorn.wav uploaded:

http://jump.fm/LLHYH

Ive already done that sooooo many times and its still not in the game. Is it because I have 911 First Responders and NOT Emergency 4? Heres how Ive been adding it in the editor: First I open editor then I Load The LOS ANGELES MOD 1.9 Then I select a vehicle and place it then I click properties and select the command and hit add command and then ok, then once im done adding it to the vehicles I want I go to Quit. Is this right???

Link to comment
Share on other sites

Yes, I believe that is correct. Well, when I load 1.9 I get that error that I posted in my last message. Also, I ignored it and went into game and most of the commands are gone and the icon can't even be clicked. I guess we will have to wait for SAP to read this and reply.

Link to comment
Share on other sites

Guest xxGTAPRO4LIFExx
Yes, I believe that is correct. Well, when I load 1.9 I get that error that I posted in my last message. Also, I ignored it and went into game and most of the commands are gone and the icon can't even be clicked. I guess we will have to wait for SAP to read this and reply.

I figured out the problem but I dont know how to fix it. Ok when ever I take the program folder off of read only, it automatically goes back on. Like I right click on my wizard works folder and I uncheck read only then it asks if I want to apply it to that folder only or that folder and all subfolders, so I click apply to all subfolders and I hit apply then ok but when I open up the properties again it says read only. Any suggestions?

Link to comment
Share on other sites

I'm not sure how to fix it. Sorry. But the error I kept getting I got rid of by using this code

 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)
{
}
};

The only problem now is getting it to shut off. It stays on.

Link to comment
Share on other sites

Guest [SAP]Francis

The code is now completely fixed:

object VcmdHorn : CommandScript
{
VcmdHorn()
{
SetIcon("sirenson");
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)
{
Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", Caller->GetPosition(), false);
}
};

Have fun.

Link to comment
Share on other sites

I figured out the problem but I dont know how to fix it. Ok when ever I take the program folder off of read only, it automatically goes back on. Like I right click on my wizard works folder and I uncheck read only then it asks if I want to apply it to that folder only or that folder and all subfolders, so I click apply to all subfolders and I hit apply then ok but when I open up the properties again it says read only. Any suggestions?

U meant to click apply once uve unchecked read only! and tht should save ur settings!

Link to comment
Share on other sites

Guest xxGTAPRO4LIFExx
U meant to click apply once uve unchecked read only! and tht should save ur settings!

I did, after I Un-Check read only I hit apply then it asks me if I want to apply to all subfolders and I click apply then I click okay but whenever I open the properties again it shows a read only

I did, after I Un-Check read only I hit apply then it asks me if I want to apply to all subfolders and I click apply then I click okay but whenever I open the properties again it shows a read only

Is it because its in my program files folder? Please help me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

Link to comment
Share on other sites

Well, the script worked. But, the airhorn does not stick with the truck. Like, lets say I hit the button when the truck is leaving the station, the siren stays at the station instead of staying on the truck. How do I fix that?

Link to comment
Share on other sites

Guest tjhugentobler

Hi everyone,

I have succesfully added the airhorn to the vehicles, but how would I add the Q-Siren to the fire vehicles? Anyone have an explanation, or a script I can add?

Thanks,

Taylor

Link to comment
Share on other sites

Guest [SAP]Francis
Okay, you know how when you turn on the sirens and where ever the truck is the siren is? Well with the airhorn it stays in the place it's activated while the truck is still moving.

You have the wrong script then. Because the script I gave you plays the air horn once, at the vehicle's current location.

Link to comment
Share on other sites

You have the wrong script then. Because the script I gave you plays the air horn once, at the vehicle's current location.

Below is what I have in my LAHorn.script file. Which is the most recent one you posted. It plays it over and over as well as stays in the spot and not with the vehicle.

object VcmdHorn : CommandScript
{
VcmdHorn()
{
SetIcon("sirenson");
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)
{
Audio::PlaySample3D("mod:Audio/FX/Sirens/airhorn.wav", Caller->GetPosition(), false);
}
};

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...