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.

Getting Ped details

Featured Replies

I'm sure I've seen this in other callouts, but cant for the life of me figure it out. Is there a way somehow to get the particulars of a ped you've spawned, such as name/gender/etc?

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

On 20/07/2015 at 5:18 AM, Sam said:

Persona Data


Persona pedPersona = API.Functions.GetPersonaForPed(Game.LocalPlayer.Character, null);
Game.DisplayNotification(String.Format("My name is {0} and I am a {1}, born on {2}.", pedPersona.FullName, pedPersona.Gender.ToString().ToLower(), pedPersona.BirthDay.ToShortDateString()));

Used in conjunction with Game.DisplayNotifiction as shown above, This example might produce the following output:


My name is Will Peavey and I am a male, born on 16/01/1991

 

  • Author

Aha, thanks! Couldn't find it as Persona doesnt exist within the api itself, I had to reference LSPD_First_Response.Engine.Scripting.Entities. I've read elsewhere that this is frowned upon and will be removed in future versions, hopefully they'll move Persona to Mod.API at the same time.

My YouTube Channel: Darkmyre Gaming (Australian LSPDFR patrols, plugins in development, and other games)

My Discord Server | AusGamer Network

 

Please do not PM me for technical support or bug reports, use the appropriate forum or plugin's comments instead.

1 hour ago, Darkmyre said:

Aha, thanks! Couldn't find it as Persona doesnt exist within the api itself, I had to reference LSPD_First_Response.Engine.Scripting.Entities. I've read elsewhere that this is frowned upon and will be removed in future versions, hopefully they'll move Persona to Mod.API at the same time.

Correct, I would recommend that you avoid using anything that is outside of the Mod.API namespace as it will all eventually be made internal and thus prevent you from accessing it. You'll then have to re-write code for things you're making. It's easier to just not bother for the time being and extend when it's available in the API.

And don't forget to check out the github for common and useful code snippets that have been given to you by the keen developers.
https://github.com/LMSDev/LSPDFR-API

Live Streaming daily from 8pm GMT (UK) at https://twitch.tv/OfficialLukeD - I play a variety of things 😄

Join my official discord server for support, general chat and my stream schedule! https://discord.gg/Mddj7PQ

  • 2 weeks later...

I'm trying to do 

Persona pedPersona = API.Functions.GetPersonaForPed(Game.LocalPlayer.Character, null);

but I get a squiggly on the API portion. Do I have the wrong reference added or is this obsolete as of the new Rage?

Ped human = new Ped(spawn);

 Persona persona = Functions.GetPersonaForPed(human);

try dat.

 

 

7 minutes ago, download500 said:

I'm trying to do 


Persona pedPersona = API.Functions.GetPersonaForPed(Game.LocalPlayer.Character, null);

but I get a squiggly on the API portion. Do I have the wrong reference added or is this obsolete as of the new Rage?

 

Edited by tanu1215

12 hours ago, download500 said:

I'm trying to do 


Persona pedPersona = API.Functions.GetPersonaForPed(Game.LocalPlayer.Character, null);

but I get a squiggly on the API portion. Do I have the wrong reference added or is this obsolete as of the new Rage?

Which namespaces have you imported at the top with the using keyword?

Try changing it to LSPD_First_Response.Mod.API, or you can keep it as-is, and insert "using LSPD_First_Response.Mod;" at the top of your class file.

If you hover your mouse over the squiggly line on API (or look at the Error List window), Visual Studio will tell you what's wrong. Either it doesn't know what API is (because LSPD_First_Response.Mod is not imported), or you have two references that both have an API namespace, and it doesn't know which one to use.

Edited by Stealth22

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

1 hour ago, tanu1215 said:

@Stealth22 Wait, im personally using  engine.scripting.entities..

Am I supposed to be using something else for personas?

You need that namespace for the Persona class, but you also need to import LSPD_First_Response.Mod in order to access the API.Functions.GetPersonaForPed function.

Either that, or change that line to LSPD_First_Response.Mod.API.Functions.GetPersonaForPed

Stealth22
LSPDFR Tester | Plugin Developer
My Plugins: Code 3 Callouts | Traffic Control | Keep Calm | ALPR+

Please do not PM me for any kind of technical support.
I unfortunately do not have enough free time to answer every PM that I get. For issues with my plugins, please post in the comments section of the file, or it's forum thread. You'll get a much quicker response from me there than if you send me a PM; I do my best to respond to every question in the comments sections. For API/programming questions, please post them in the API Development forum, so all developers can benefit from the answer as well. Thanks!

42 minutes ago, Stealth22 said:

You need that namespace for the Persona class, but you also need to import LSPD_First_Response.Mod in order to access the API.Functions.GetPersonaForPed function.

Either that, or change that line to LSPD_First_Response.Mod.API.Functions.GetPersonaForPed

Okay good, just checking.

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.