Jump to content

Vehicle Weapons


Rextox

Recommended Posts

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!

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