Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DignityDC authored Mar 12, 2024
1 parent 0e42d2e commit ab0d23a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
29 changes: 29 additions & 0 deletions gasmask/client.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local gasMaskIDs = {36, 38, 46, 129, 130, 166, 175} -- Add the gas mask IDs you want to include in the table

function isWearingGasMask(playerPed)
local maskIndex = GetPedDrawableVariation(playerPed, 1)

for _, maskID in ipairs(gasMaskIDs) do
if maskIndex == maskID then
return true
end
end

return false
end

Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)

local playerPed = GetPlayerPed(-1)

if DoesEntityExist(playerPed) and not IsEntityDead(playerPed) then
if isWearingGasMask(playerPed) then
SetEntityProofs(playerPed, false, false, false, false, false, false, true, true, false)
else
SetEntityProofs(playerPed, false, false, false, false, false, false, false, false, false)
end
end
end
end)
7 changes: 7 additions & 0 deletions gasmask/fxmanifest.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fx_version 'cerulean'
game 'gta5'

author 'DignityDC'
description 'Gas Mask Script'

client_script 'client.lua'

0 comments on commit ab0d23a

Please sign in to comment.