Created
April 13, 2017 19:16
-
-
Save drsn0w/4a8554ffe157513f4081389462ae73e0 to your computer and use it in GitHub Desktop.
Set a Ped as wanted using extension methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using LSPD_First_Response.Mod.API; | |
using LSPD_First_Response.Engine.Scripting.Entities; | |
using Rage; | |
namespace RoutinePoliceWork | |
{ | |
public static class ExtensionMethods | |
{ | |
public static Ped SetWanted(this Ped oPed, bool isWanted) | |
{ | |
Persona oldPersona = Functions.GetPersonaForPed(oPed); | |
Persona newPersona = new Persona(oPed, oldPersona.Gender, oldPersona.BirthDay, oldPersona.Citations, oldPersona.Forename, oldPersona.Surname, oldPersona.LicenseState, oldPersona.TimesStopped, isWanted, oldPersona.IsAgent, oldPersona.IsCop); | |
Functions.SetPersonaForPed(oPed, newPersona); | |
return oPed; | |
} | |
public static bool IsWanted(this Ped oPed) | |
{ | |
Persona persona = Functions.GetPersonaForPed(oPed); | |
return persona.Wanted; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment