Jump to content

setElementData(source, "gasmask"0) doesnt work


Recommended Posts

No Errors

elseif (itemID==26) then -- GASMASK 
            local gas = getElementData(source, "gasmask") 
             
            if not (gas) or (gas==0) then 
                exports.global:sendLocalMeAction(source, "slips a black gas mask over their face.") 
                 
                -- can't see their name 
                local pid = getElementData(source, "playerid") 
                local fixedName = "Unknown Person(Gas M)" 
                setPlayerNametagText(source, tostring(fixedName)) 
                setElementData(source, "gasmask", 1) 
  
                exports['anticheat-system']:changeProtectedElementDataEx(source, "gasmask", 1, false) 
            elseif (gas==1) then 
                exports.global:sendLocalMeAction(source, "slips a black gas mask off their face.") 
                 
                -- can't see their name 
                local pid = getElementData(source, "playerid") 
                local name = string.gsub(getPlayerName(source), "_", " ") 
                setPlayerNametagText(source, tostring(name)) 
                setElementData(source, "gasmask", 0) 
  
                exports['anticheat-system']:changeProtectedElementDataEx(source, "gasmask", 0, false) 
            end 

elseif (itemID==56) then -- MASK 
            local mask = getElementData(source, "mask") 
             
            if not (mask) or (mask==0) then 
                exports.global:sendLocalMeAction(source, "slips a mask over their face.") 
                 
                -- can't see their name 
                local pid = getElementData(source, "playerid") 
                local fixedName = "Unknown Person(Mask)" 
                setPlayerNametagText(source, tostring(fixedName)) 
                setElementData(source, "mask", 1) 
  
                exports['anticheat-system']:changeProtectedElementDataEx(source, "mask", 1, false) 
            elseif (mask==1) then 
                exports.global:sendLocalMeAction(source, "slips a mask off their face.") 
                 
                -- can't see their name 
                local pid = getElementData(source, "playerid") 
                local name = string.gsub(getPlayerName(source), "_", " ") 
                setPlayerNametagText(source, tostring(name)) 
                setElementData(source, "mask", 0) 
  
                exports['anticheat-system']:changeProtectedElementDataEx(source, "mask", 0, false) 
            end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...