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.

[SOLVED] SetVariation Method (incl. API)

Featured Replies

Hi,

 

im making a plugin for lspdfr right now and I have encountered folowing problem.

 

The plugin includes: using LSPD_First_Response.Mod.API;using Rage;using LSPD_First_Response.Engine.Scripting.Entities; (the last one just to be safe, because using "Ped"-Entity)

 

CODE: i get all the peds with World.GetAllPeds(); and then i want to set "myPed" variation different with "foreach"-operator. But it is not working:

=============================================================================

For example:

 

myPed.Kill(); - works just fine in same segment of code (the rest of code seems working correct as desired)

but should i change to myPed.SetVariation(int, int, int) - it doesn't work, although i'm using the method as it is described in RAGE Documentation, nothing happens.

i also know that int numbers are correct since it works on Player Model perfectly.

 

So the SetVariation seems to be the Problem/ incorrect method. Is there something in between? myPed.Model.SetVariation seems not to exist.

=============================================================================

 

I hope for some help.

 

 

 

Edited by amateurModder

Do you have "Using Rage;" in your file? 

 

It's not Ped.Model.SetVariation, it's just Ped.SetVariation. You should be get an Intellisense prompt to help you autocomplete it. 

 

What "doesn't work"? Are you getting an error in VS before you compile? Does it crash when you run it? "It's not working" doesn't tell us enough info to help you diagnose the problem. 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

  • Author

1. using Rage included, see first post.

 

2. i try myPed.SetVariation (which is an available option in autocomplete) but it doesn't change the variation (ped stays the same) , also the code stops working there since no upcoming notifications appear (set up for debug).

 

---CODE---

Game.DisplayNotification("~r~ready to change");

myPed.SetVariation(int, int, int);

Game.DisplayNotification("~r~model changed");

---CODE---

 

The "model changed"-message won't appear and the model/variation doesn't change at all. 

But myPed Object is legit, since if replace myPed.SetVariation(int, int, int) to myPed.Kill(); - all peds die and "model changed"- message appears.

 

3. no errors. Weather it is compile or in-game. it just doesn't change the ped appearance.

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

Similar Content

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.