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.

ThornabySean

Members
  • Joined

  • Last visited

  1. Thanks @PNWParksFan, I had already realised and added in checks for existing blips - newb error!
  2. Hi AlconH, Thank you for taking the time to reply, but this is not for a traffic stop so LSPDFR will not kick in. I want to have the ability to stop all vehicles within the vicinity of a Vector3 position, the above code works but has a big issue with screen refreshed so everything goes black! I have added in a check so the Blip does not get constantly redrawn (which was an issue in what I posted last week!) but still hitting this issue. I have looked and there does not appear to be an API call for this functionality, hence the reason for trying to create it myself; but admittedly this is part of my first Plugin. Cheers.
  3. Hi all, I am hoping someone can help with the script method I am using to close nearby roads. Based on a scenario the player is asked if the roads should be closed (to protect civs etc!); I have a script which runs and does work but it is not very performance friendly so I was hoping for a better way of achieving the road closure. At the minute based on the players position I am using ped.GetNearbyVehicles(16) and then looping through the vehicles to freeze the position of the vehicle. This works great to start with but then ends up being performance intensive after a while. The below is the function which is being called - I am passing the blip back so I can then remove it later. public static Blip CloseRoadsInAreaOfPed(Ped CloseRoadsAround, float DistanceFromCentre) { Vehicle CurrentVehicle; Vehicle[] AllVehicles; AllVehicles = CloseRoadsAround.GetNearbyVehicles(16); for (int i = 0; i < AllVehicles.Length; i++) { CurrentVehicle = AllVehicles[i]; if (CloseRoadsAround.DistanceTo(CurrentVehicle) < DistanceFromCentre) { CurrentVehicle.IsPositionFrozen = true; } } //Now place ablip around the area where the road is closed Blip RoadClosed = new Blip(CloseRoadsAround.Position, DistanceFromCentre); RoadClosed.Color = Color.Cyan; RoadClosed.Name = "Road Closure"; return RoadClosed; }
  4. Hi DMes71, I have previously created myself a common function to call for this reason - spawning peds. I use the below: public static unsafe Vector3 GetSafeCoordsForPed(Vector3 CheckPoition) { Vector3 ReturnPosition; NativeFunction.CallByName<bool>("GET_SAFE_COORD_FOR_PED", CheckPoition.X, CheckPoition.Y, CheckPoition.Z, true, &ReturnPosition.X, &ReturnPosition.Y, &ReturnPosition.Z, 0); if (ReturnPosition == Vector3.Zero) { return CheckPoition; } else { return ReturnPosition; } } If this function returns a Vector3.Zero value then the function was unable to find a safe location to spawn a ped. Please also be aware that a 'Safe Position' only seems to be not on a road. I am new at RPH and LSPDR plugins so there maybe a better way but this is how I have implemented this.
  5.    Deactivated Member reacted to a post in a topic: Getting Random Ped to not Flee
  6. It is not that the ScriptHookV doesn't support the newest version of the game 'anymore', ScriptHookV never supported this mornings update - Rockstar updated GTAV this morning and have changed some of the code base. So when you have started ScriptHookV it has seen that the GTAV version is higher than it was yesterday, and is now a version which it doesn't explicitly know about. Give it a while and the ScriptHookV (and RagePluginHook) devs will update their programs to work with this version .... but depending on the number of changed made will depend on the time this takes. Enjoy the new online features and keep an eye out for the updates.
  7.    Albo1125 reacted to a post in a topic: Getting Random Ped to not Flee
  8. Thank you all for your help, after a lot of playing about the answer I have just tested was very close to what Albo said (not that I ever expect anything Albo says to be wrong!) NPC.BlockPermanentEvents = true; NPC.GiveNewWeapon("WEAPON_BAT", 20, true); NPC.RelationshipGroup = MyEnemyGroup; Rage.Native.NativeFunction.Natives.TaskCombatPed(NPC, Game.LocalPlayer.Character, 0, 16); <------ setting this to 16 was the difference, setting back to 1 meant they ran away again The enemy group will come in handy later in a different scenario where the ped 'calls in his mates' :-) Thank you all for taking the time to respond.
  9. No this has the same results, all Ped just ran away. I have added a line above to give the Ped a weapon but that is just so that I can see something happen on screen. I have removed this line as well but no difference in Ped reaction.
  10. I have 2 completely separate projects; 1 is my actual callout, the other is testing - I have done it this way so I don't need to run through full scenarios in-game to test a new set of code - I just put the new code into the Testing project, compile and run so I can test the code straight away. Once I have am happy the new code works (like this this piece of code); I will then add it into my working callout project :-)
  11. This is just a testing project where I can test code works before adding it into the main project! The code is just located in the Main() section of the single class file (which is the only class file in the project - testing!): private static void Main() I have a check for a keypress which then grabs the closest ped (as in the officer speaking to the ped) then the code above is executed .... all in one class and one Main() function for testing. Apologies if this is a bit 'noob'; I am just getting back into dev after about 10 years out!
  12. Thank you for replying. Appologies, I never sent the whole code segment but thought it better not to put too much in my first post. I do already have that native function included further down. I have the below but the Peds still continue to flee: NativeFunction.CallByName<uint>("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", NPC, 1); NativeFunction.CallByName<uint>("SET_PED_FLEE_ATTRIBUTES", NPC, 1, 1); //NativeFunction.CallByName<uint>("SET_PED_COMBAT_ATTRIBUTES", NPC, 46, true); NPC.RelationshipGroup = "MYENEMY"; WeaponAsset NPC_Knife = new WeaponAsset("WEAPON_BAT"); NPC.GiveNewWeapon(NPC_Knife, 1, true); Game.SetRelationshipBetweenRelationshipGroups("MYENEMY", Game.LocalPlayer.Character.RelationshipGroup.Name, Relationship.Hate); NativeFunction.CallByName<uint>("TASK_COMBAT_PED", NPC, Game.LocalPlayer.Character, 0, 1); As you can see I have also created the group relationships; and I presume this works because when the code runs and the Ped is set to the Enemy group and the relationship is 'Enemy'; some other peds in the area run away as they see two enemies (I am presuming this is a default action for peds who see 2 enemies within their vicinity). P.S. Ignore the variable stating knife but weapon being a bat - playing about!
  13. Hey, I was wondering if someone could help me out with what could well be a simple issue (take it easy I am new to game mods!). I am trying to create my first mod. As part of the mod I have a conversation with a random ped (not ped spawned by script). The outcome of the conversation could be a fight but every time I get to that point the ped just runs away (flees). I have been looking at this a while and struggling to find out how to stop this behavior and make him stay and fight. I currently have this to try and make him stay and fight: NativeFunction.CallByName<uint>("SET_BLOCKING_OF_NON_TEMPORARY_EVENTS", NPC, 1); NativeFunction.CallByName<uint>("SET_PED_FLEE_ATTRIBUTES", NPC, 0, 0); NativeFunction.CallByName<uint>("SET_PED_COMBAT_ATTRIBUTES", NPC, 46, true); NPC is the variable of the ped. I have tried giving the ped a weapon first but they still flee; and also playing about with the parameters being passed but still no luck. Any help would be much appreciated.

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.