laserlaser Posted November 18, 2010 Share Posted November 18, 2010 (edited) Hello,this my new script I write script at old days The Code: local isMapDM local isMapRace function gmActive( gmactv ) if gmactv==1 then for k,v in ipairs(getElementsByType("player")) do setElementData( v, "overrideCollide.uniqueblah", 0, false ) outputChatBox("Ghostmode Enabled by Server",v,0,255,0,true) set("*ghostmode",true) end else for k,v in ipairs(getElementsByType("player")) do setElementData( v, "overrideCollide.uniqueblah", nil, false ) set("*ghostmode",false) outputChatBox("Ghostmode Disabled by Server",v,255,0,0,true) end end end function onMapStarting(mapInfo, mapOptions, gameOptions) local isRace = 0 local isDM = 0 if #getElementsByType("checkpoint")>=1 then isRace=1 isMapDM=0 isMapRace=1 end if isRace==1 then gmActive(1) else for a,c in ipairs(getElementsByType("racepickup")) do if getElementData(c,"type")=="vehiclechange" then if tonumber(getElementData(c,"vehicle")) == 425 then isDM=1 isMapDM=1 isMapRace=0 end end end if isDM==1 then gmActive(1) else gmActive(0) end end end addEvent("onMapStarting",true) addEventHandler("onMapStarting",getRootElement(),onMapStarting) MADE in TURKEY |-War Of Empire -> Lua Team Edited November 28, 2010 by Guest Link to comment
Aibo Posted November 18, 2010 Share Posted November 18, 2010 great, now learn about booleans in Lua and «isDM=isDM» is Captain Obvious style. Link to comment
laserlaser Posted November 28, 2010 Author Share Posted November 28, 2010 Bugs fixed. Link to comment
stefanziac Posted December 2, 2010 Share Posted December 2, 2010 seni burda da görmek ne hoş bi şeref kardeşm bana bi yardım et artık. cidden çok fena sıkıştım köşeye.. yardımına ihtiyacım var Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now