diff --git a/package.json b/package.json index ccfbf296..dd06a2bb 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "whitelist/server.lua", "animation/server.lua", "police/s_police.lua", + "police/s_police_doors.lua", "stylist/server.lua", "idcard/server.lua", "licenses/server.lua", diff --git a/police/s_police_doors.lua b/police/s_police_doors.lua new file mode 100644 index 00000000..0ee011c0 --- /dev/null +++ b/police/s_police_doors.lua @@ -0,0 +1,24 @@ +local modelsPrison = { + {model = 5}, + {model = 7}, + {model = 10}, + {model = 11}, + {model = 12}, + {model = 13}, + {model = 14}, + {model = 15}, + {model = 16}, + {model = 39} +} + +AddEvent("OnPlayerInteractDoor", function(player, door) + for k, v in pairs(modelsPrison) do + if GetDoorModel(door) == v.model then + if PlayerData[player].job == 'police' then + SetDoorOpen(door, IsDoorOpen(door)) + else + SetDoorOpen(door, not IsDoorOpen(door)) + end + end + end +end) \ No newline at end of file