Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add("KeyPress", "VehicleBinds", function(ply, key)
- if ply:InVehicle() then
- if key == IN_JUMP then
- local trace = util.TraceLine{
- start = ply:GetShootPos(),
- endpos = ply:GetShootPos() + ply:GetAimVector()*750,
- filter = {ply, ply:GetVehicle()}
- }
- if ValidEntity(trace.Entity) and cider.entity.isDoor(trace.Entity) then
- if cider.player.hasDoorAccess(ply, trace.Entity) then
- trace.Entity:Fire("lock", "", 0);
- ply:EmitSound("doors/door_latch3.wav");
- else
- cider.player.notify(ply, "You do not have access to this door!", 1);
- end
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement