Hey Scripters!
This is my first script, but somehow it won't work..
The script should make so vehicle weapons will be turned on at map start.
vwontext = get("vwontext")
vwoncolor = get("vwoncolor")
vwofftext = get("vwofftext")
vwoffcolor = get("vwoffcolor")
addEvent("onMapStarting")
addEventHandler("onMapStarting", getRootElement(),
function(mapInfo)
if string.find(mapInfo.name, "[DM]", 1, true) or mapInfo.modename == "Sprint" then
vwon()
else
vwoff()
end
end)
function vwon()
for theKey,thePlayer in ipairs(getElementsByType("player")) do
setElementData( thePlayer, "overrideVehicleWeapons.uniqueblah", 0, false )
outputChatBox(vwoncolor..vwontext,thePlayer,186,212,71,true)
end
end
function vwoff()
for theKey,thePlayer in ipairs(getElementsByType("player")) do
setElementData(thePlayer, "overrideVehicleWeapons.uniqueblah", nil, false )
outputChatBox(vwoffcolor..vwofftext,thePlayer,255,255,255,true)
end
end
I only says the output text, allthrough it says the text that it's on.. But actually it isnt.. Either in DD/Fun maps where it says it's disabled. They aren't.
I hope you understand me!