@@ -18,7 +18,7 @@ add a new ped to be handled by the manager. allows for target options, animation
1818 - ` pos? ` (` vec3 ` ): position of the prop relative to the bone its attached to
1919 - ` rot? ` (` vec3 ` ): rotation of the prop relative to the bone its attached to
2020 - ` targetOptions? ` (` table ` ): an array of ` ox_target ` [ options] ( https://overextended.dev/ox_target/Options )
21- - ` interactOptions? ` (` table ` ): a ` sleepless_interact ` [ local entity interaction ] ( https://sleeplessdevelopment.dev/interact/ client/addLocalEntity )
21+ - ` interactOptions? ` (` table ` ): a ` sleepless_interact ` [ Option or array of Options ] ( /interactv2/ client/interactOptions )
2222 - ` renderDistance? ` (` number ` ): distance from the player at which the ped spawns
2323 - ` onSpawn? ` (` function(ped?: number) ` ): a function that gets called right * AFTER* the ped is spawned
2424 - ` onDespawn? ` (` function(ped?: number) ` ): a function that gets called right * BEFORE* the ped is despawned
@@ -53,28 +53,34 @@ local pedPoint = exports.sleepless_pedmanager:addPed({
5353 serverEvent = " some event"
5454 },
5555 },
56- interactOptions = {
57- id = " uniqueID" ,
58- options = {
59- {
60- label = " Local Interact Option" ,
61- icon = " hand" , -- Example simple FA icon name
62- -- groups = {['police'] = 1},
63- -- items = {['money'] = 100},
64- onSelect = function (data ) print (" Local entity action triggered" ) end ,
65- canInteract = function (entity , distance , coords , id )
66- return distance < 2.0 -- Example condition based on distance
67- end
68- }
56+ interactOptions = { -- sleepless_interact v2 options
57+ {
58+ label = " Talk to Ped" ,
59+ name = " talk_to_ped" ,
60+ icon = " comments" ,
61+ distance = 2.0 ,
62+ onSelect = function (data )
63+ print (" Talking to ped" )
64+ end ,
65+ canInteract = function (entity , distance , coords , name )
66+ return distance < 2.0
67+ end
6968 },
70- renderDistance = 10.0 ,
71- activeDistance = 2.0 ,
72- cooldown = 1500
69+ {
70+ label = " Trade with Ped" ,
71+ name = " trade_with_ped" ,
72+ icon = " hand-holding-dollar" ,
73+ distance = 2.0 ,
74+ cooldown = 1500 ,
75+ onSelect = function (data )
76+ print (" Trading with ped" )
77+ end
78+ }
7379 },
7480 onSpawn = function (ped )
7581 GiveWeaponToPed (ped , ` WEAPON_RPG` , 100 , false , true )
7682 SetCurrentPedWeapon (ped , ` WEAPON_RPG` , true )
7783 end ,
7884 onDespawn = function (ped )
7985 end
80- })
86+ })
0 commit comments