Skip to content

Instantly share code, notes, and snippets.

@drsn0w
Created April 13, 2017 19:16
Show Gist options
  • Save drsn0w/4a8554ffe157513f4081389462ae73e0 to your computer and use it in GitHub Desktop.
Save drsn0w/4a8554ffe157513f4081389462ae73e0 to your computer and use it in GitHub Desktop.
Set a Ped as wanted using extension methods
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