Creating new steering
This commit is contained in:
26
koptilnya/steering/steering_controller.txt
Normal file
26
koptilnya/steering/steering_controller.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
SteeringController = class("SteeringController")
|
||||
|
||||
function SteeringController:initialize()
|
||||
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)
|
||||
end
|
||||
|
||||
function SteeringController:update()
|
||||
-- print()
|
||||
end
|
||||
|
||||
function SteeringController:setDriver(ply)
|
||||
self.driver = ply
|
||||
end
|
||||
Reference in New Issue
Block a user