Jump to content

Entity Spawning?


Deactivated Member

Recommended Posts

Hey guys,

I am attempting to make my first callout which is a convoy attack. I am running into a problem with spawning peds and vehicles.

This is the problem:

Spoiler

2015-12-09_00001.thumb.jpg.4c6cb3abbe0082015-12-09_00002.thumb.jpg.2dcde03b3e7a5

It all spawns on top of each other, so I tried to resolve this problem by doing this:
 

 //Officer Spawns
            officer1 = new Ped("s_m_y_hwaycop_01", spawn, 0f);
            Vector3 o1 = officer1.GetOffsetPosition(new Vector3(15f, -3f, 0f));
            officer2 = new Ped("s_m_y_hwaycop_01", o1, 0f);
            officer2.GetTextureVariationCount(0, 1); //Another "look" or "clothing style" of this ped
            o1 = officer1.GetOffsetPosition(new Vector3(12f, -8f, 0f));
            officer3 = new Ped("s_m_y_hwaycop_01", o1, 0f);
            officer3.GetTextureVariationCount(0, 2);

Basically just using GetoffsetPosition..

Is there a better / more efficient way of doing this? I'd prefer to have officers on one side, and bad guys on the other (all shielded by their vehicles).

Thanks,
Tanu / Talatactics

Edited by tanu1215
Link to comment
Share on other sites

Vector3 o1 = officer1.GetOffsetPosition(Vector3.RelativeFront * 3f);

Same can be done with Vector3.RelativeBack etc.

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

Link to comment
Share on other sites

30 minutes ago, Albo1125 said:

Vector3 o1 = officer1.GetOffsetPosition(Vector3.RelativeFront * 3f);

Same can be done with Vector3.RelativeBack etc.

So if I use this, I can make it have officers and their vehicles on one side of the street and gunmen and their vehicle on the other?

What if streets happen to be too narrow? Ex: Vinewood hills?

Link to comment
Share on other sites

1 hour ago, tanu1215 said:

So if I use this, I can make it have officers and their vehicles on one side of the street and gunmen and their vehicle on the other?

What if streets happen to be too narrow? Ex: Vinewood hills?

If you want precise locations, the best thing is to collect the location data yourself. 

You can oppose vehicles and officers with RelativeLeft or relativeright and relative front or relative back respectively.

My YouTube: Click here. 

My Discord Server - https://discord.gg/0taiZvBSiw5qGAXU

Useful post? Let me and others know by clicking the Like button.
Check out my many script modifications! 
Having issues? LSPDFR Troubleshooter by Albo1125.

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