local act = false
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('trigger', obj_func)
wait(-1)
end
function obj_func()
act = not act
if act then
obj = createObject(Model model, float atX, float atY, float atZ)
thread = lua_thread.create(function()
repeat wait(0) until isCharTouchingObject(PLAYER_PED, obj)
event_func()
end)
else
deleteObject(obj)
thread:terminate()
end
end
function event_func()
sampAddChatMessage('Твой триггер',-1)
-- код триггера
end