Jump to content

getElementData


Vinspire

Recommended Posts

Hello folks, I'd like to use getElementData & set to enable/disable spectatorkill with this function but I have no clue how to do it tbh. Could any of you edit the lua below to show me how you do it?

addEvent("onRaceStateChanging") 
addEventHandler("onRaceStateChanging", root, 
function (newState) 
 if newState == "Running" then 
  local theSpectatorTeam = getTeamFromName("Spectators") 
        if ( theSpectatorTeam ) then 
        local players = getPlayersInTeam ( theSpectatorTeam ) 
        for key, player in ipairs ( players ) do 
            local theVehicle = getPedOccupiedVehicle ( player ) 
                if ( theVehicle ) then 
                blowVehicle(theVehicle,false) 
                setElementPosition(getPedOccupiedVehicle(thePlayer), 0, 0, 0) 
                setElementHealth(thePlayer, 0) 
                end 
            end 
        end 
    end 
end) 
  

Thanks

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...