File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,12 @@ Native functions that expect a parameter of type `Any *` as an argument can take
6868local t = {}
6969local ffi = require ' ffi'
7070
71+ function t .OnLoad ()
72+ t .me = PLAYER :PLAYER_ID ()
73+ t .me_ent = PLAYER :GET_PLAYER_PED (t .me )
74+ t .ent_arr = native .new (' Entity' , 1024 )
75+ end
76+
7177function t .OnTick ()
7278 if misc .iskeyjustup (VK_F8 , true ) then
7379 local duration = ffi .new ([[
@@ -102,10 +108,11 @@ function t.OnTick()
102108 end
103109 -- If you press F9 it will knock out all peds around you
104110 if mish .iskeyjustup (VK_F9 , true ) then
105- local cnt = native .allpeds (mod .ent_arr ) - 1
111+ local cnt = native .allpeds (t .ent_arr ) - 1
106112 for i = 0 , cnt do
107- if mod .ent_arr [i ] ~= mod .me_ent then
108- TASK :TASK_KNOCKED_OUT (mod .ent_arr [i ], 10 , false )
113+ if t .ent_arr [i ] ~= t .me_ent then
114+ TASK :CLEAR_PED_TASKS (t .ent_arr [i ], false , false )
115+ TASK :TASK_KNOCKED_OUT (t .ent_arr [i ], 10 , false )
109116 end
110117 end
111118 end
114121return t
115122```
116123
117- Here is a list of all the Lua functions provided by the RedLua library :
124+ Here is a list of all the Lua functions provided by RedLua:
118125
119126``` lua
120127--[[
You can’t perform that action at this time.
0 commit comments