-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |