Continuing to implement new steering, removed common.txt, inside functions have been moved to separate files

This commit is contained in:
Иван Грачёв
2021-03-26 22:42:51 +05:00
parent 2f8c949776
commit 5c854e183b
6 changed files with 91 additions and 49 deletions

View File

@@ -1,24 +1,17 @@
-- @include ../libs/constants.txt
require("../libs/constants.txt")
SteeringController = class("SteeringController")
function SteeringController:initialize()
function SteeringController:initialize(base)
self.seat = NULL_ENTITY
self.driver = NULL_ENTITY
hook.add("PlayerEnteredVehicle", "", function(ply, veh)
if veh == self.seat then
self.driver = ply
end
end)
hook.add("PlayerLeaveVehicle", "", function(ply, veh)
if veh == self.seat then
self.driver = NULL_ENTITY
end
end)
self.base = base
end
function SteeringController:update()
-- print()
end
function SteeringController:setDriver(ply)