Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Spawning Objects

Featured Replies

I have tried nearly every way i can to spawn objects and the one time i get code with no errors it crashes the game.

Does anyone have code that can spawn  objects without crashing.

rage.docs code doesn't work for me.

BWelch

I was going to post this exact question but with alittle bit more detail, i also need to attatch the prop to the spawns peds hand. I have this code currently, doesnt throw an error but does seem to kill my callout without spawning anything.

 

public void attachSprayCan()
        {
            Vector3 sprayCanOffset = new Vector3(0, 0, 0);
            Rotator spraycanRotation = new Rotator(0, 0, 0);
            int boneIndex = Suspect.GetBoneIndex("SKEL_R_Hand");
            SprayCan = new Rage.Object("ng_proc_spraycan01b", SpawnPoint, 0f);
            SprayCan.AttachTo(Suspect, boneIndex, sprayCanOffset, spraycanRotation);
            Game.LogTrivial("OTB - SprayCan added to ped's right hand" + boneIndex.ToString());
        }

Hopefully someone out there could help both of us at the same time plus hopefully the additonal information should be useful for you Bleddyn

Officer Dog, Sye Dog.

4 minutes ago, Bleddyn Welch said:

yea my game only crashed when looking at the object. My spawning is for my drug bust calllout trying to spawn some weed plants and tables.z

Cant even get mine to spawn with the code above

Officer Dog, Sye Dog.

20 minutes ago, Bleddyn Welch said:

i have no clue but the code i used is 


SprayCan = new Rage.Object("ng_proc_spraycan01b", SpawnPoint, 0f);

but with other names and heading

 

fixed it myself, it was an error with my animation code as it was waitingforcompletion forever and never getting to the point where i spawn the can

 

public void attachSprayCan()
        {
            Vector3 sprayCanOffset = new Vector3(0, 0, 0);
            Rotator spraycanRotation = new Rotator(0, 0, 0);
            int boneIndex = Suspect.GetBoneIndex("BONETAG_R_HAND");
            SprayCan = new Rage.Object("ng_proc_spraycan01b", SpawnPoint, 0f);
            SprayCan.AttachTo(Suspect, boneIndex, sprayCanOffset, spraycanRotation);
            Game.LogTrivial("OTB - SprayCan added to ped's right hand" + boneIndex.ToString());
        }

There is probably a much cleaner and better way of doing this but this is my working code for spawning in a spraycan and attaching it to the spawned peds right hand.

Best way i found to find prop names was to use openIV and search for the name or object you want which will return a object file with the correct name to use. Hopefully some of this information helps!

 

You can also find the bone list in the ragehook documentation

Officer Dog, Sye Dog.

3 minutes ago, Bleddyn Welch said:

ok thanks i think i can do this now 

 

glad i helped, hopefully someone with abit more knowledge and experience can help both of us further. I just need to sort rotation now i suppose! as my cans stuck through my hand haha

 

Officer Dog, Sye Dog.

  • Author

this is the code i got this is the code i got and it doesn't spawn shit all.

 

 public void drugt()
        {
           drugtable = new Rage.Object("bkr_prop_weed_table_01a", SpawnPoint, 0f);
        } 

 

BWelch

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.