Jump to content

Peds and cars not spawning consistently


Deactivated Member

Recommended Posts

Heya!

 

I'm having a bit of trouble with my callout and I can't figure out a solid solution. I tried million of approaches but it doesnt work.

Basically what I'm trying to do is:

 

 				FireTruck = new Vehicle("FIRETRUK", FeuerTruckStop, 299.5982f);
                Ambulanc = new Vehicle("AMBULANCE", KrankenwagenSpawn, 15.85691f);
                PoliceCar = new Vehicle("POLICE2", PolizeiAutoSpawn, 116.6981f);
                Ambulanc.IsSirenOn = true; FireTruck.IsSirenOn = true; PoliceCar.IsSirenOn = true;
                Ambulanc.IsPersistent = true; FireTruck.IsPersistent = true; PoliceCar.IsPersistent = true;
                Firemen1 = new Ped("s_m_y_fireman_01", Firemen1Spawn, 0.0f);
                Firemen2 = new Ped("s_m_y_fireman_01", Firemen2Spawn, 0.0f);
                Officer = new Ped("s_m_y_cop_01", Officer1Spawn, 0.0f);
                Medic2 = new Ped("s_m_m_paramedic_01", Medic2Spawn, 0.0f);
                Medic2.IsPersistent = true; Medic2.BlockPermanentEvents = true;
                Firemen1.IsPersistent = true; Firemen1.BlockPermanentEvents = true;
                Firemen2.IsPersistent = true; Firemen2.BlockPermanentEvents = true;
                Officer.IsPersistent = true; Officer.BlockPermanentEvents = true;

I've tried running this code at the beginning before the callout is accepted, I tried running it just before those are actual used, I've tried running them in their own 'SpawnMeVoid' and just calling that.

 

What happens is:

 

Most of the times only the Ambulance and the Firetruck spawn. They spawn (as far as I saw) every time. The rest either doesn't spawn at all or spawns like it should. I could literally stay in front of the location, run the callout 10 times and either only the first two cars spawn or everything spawns.

 

Does anyone have an idea how I could fix that so it spawns consistenly?

Edited by RicardaHub
Link to comment
Share on other sites

  • 1 month later...
On 7/18/2020 at 8:02 PM, RicardaHub said:

Heya!

 

I'm having a bit of trouble with my callout and I can't figure out a solid solution. I tried million of approaches but it doesnt work.

Basically what I'm trying to do is:

 


 				FireTruck = new Vehicle("FIRETRUK", FeuerTruckStop, 299.5982f);
                Ambulanc = new Vehicle("AMBULANCE", KrankenwagenSpawn, 15.85691f);
                PoliceCar = new Vehicle("POLICE2", PolizeiAutoSpawn, 116.6981f);
                Ambulanc.IsSirenOn = true; FireTruck.IsSirenOn = true; PoliceCar.IsSirenOn = true;
                Ambulanc.IsPersistent = true; FireTruck.IsPersistent = true; PoliceCar.IsPersistent = true;
                Firemen1 = new Ped("s_m_y_fireman_01", Firemen1Spawn, 0.0f);
                Firemen2 = new Ped("s_m_y_fireman_01", Firemen2Spawn, 0.0f);
                Officer = new Ped("s_m_y_cop_01", Officer1Spawn, 0.0f);
                Medic2 = new Ped("s_m_m_paramedic_01", Medic2Spawn, 0.0f);
                Medic2.IsPersistent = true; Medic2.BlockPermanentEvents = true;
                Firemen1.IsPersistent = true; Firemen1.BlockPermanentEvents = true;
                Firemen2.IsPersistent = true; Firemen2.BlockPermanentEvents = true;
                Officer.IsPersistent = true; Officer.BlockPermanentEvents = true;

I've tried running this code at the beginning before the callout is accepted, I tried running it just before those are actual used, I've tried running them in their own 'SpawnMeVoid' and just calling that.

 

What happens is:

 

Most of the times only the Ambulance and the Firetruck spawn. They spawn (as far as I saw) every time. The rest either doesn't spawn at all or spawns like it should. I could literally stay in front of the location, run the callout 10 times and either only the first two cars spawn or everything spawns.

 

Does anyone have an idea how I could fix that so it spawns consistenly?

 Ambulanc.IsSirenOn = true; FireTruck.IsSirenOn = true; PoliceCar.IsSirenOn = true; 

You've executed a bool, ending the loop of the callout. Try putting trues at the bottom of the code (only in this scenario) rather than anywhere near the top. 

Got a problem? Want quicker response times and dedicated support? Come and join the Unofficial Fan LSPDFR Support Discord to get additional help if needed: https://discord.gg/xsdAXJb Disclaimer: This is a fan Discord, and is in no way an Official LSPDFR Discord Server, nor is it related to G17 Media or the LSPDFR Team as a whole.

Link to comment
Share on other sites

2 hours ago, Lukaz said:

 Ambulanc.IsSirenOn = true; FireTruck.IsSirenOn = true; PoliceCar.IsSirenOn = true; 

You've executed a bool, ending the loop of the callout. Try putting trues at the bottom of the code (only in this scenario) rather than anywhere near the top. 

Thanks for the info I will try that later.

 

Just so I understand it properly:

 

I call the SpawnStuff void (which is it's own fiber) during the mainfiber when the player reaches a certain point in the callout like this: "SpawnStuff();" In theory this should execute the whole block like above.

 

  1. Why does putting the Siren bools on early end the whole block prematurely?
  2. Why does it still work properly sometimes?

Anyways. Thanks for a possible fix 😄

Edited by RicardaHub
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...