Hello, I'm wondering how you use getElementData in this example (below) to disable / enable the blowVehicle, like if you do /speckill then it outputs to the chatbox > Hazard enables spectator kill / Hazard disables spectator kill.
disable = normal (not blowing any vehicles)
enable = blows all the vehicles in the spectatorteam
function spectatorkill ()
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)
end
end
end
end)
addCommandHandler("speckill", spectatorkill)
Could you do it? I would really appreciate that. Thanks alot
This is what I mean with getElementData
function toggleRespawnModeFunc ( player )
local now = getElementData ( getRootElement ( ), "cwRespawn", true )
if now then
state = "disabled"
else
state = "enabled"
end
echo ( "*"..getUncolored ( player ).. " has " ..state.." respawn mode" )
setElementData ( getRootElement ( ), "cwRespawn", not now )
setElementData ( resRoot, "respawn", getElementData ( getRootElement ( ), "cwRespawn" ) )
-- end
end
addCommandHandler ( "respawn", toggleRespawnModeFunc )
setElementData ( resRoot, "respawn", getElementData ( getRootElement ( ), "cwRespawn" ) )