Jump to content

[SOLVED] SetVariation Method (incl. API)


amateurModder

Recommended Posts

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

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