Sande Posted July 19, 2013 Share Posted July 19, 2013 Hi again I made an unworkable script, and not enough brains anymore .. Could someone is kind to fix this? server GM = 0 function freeroamGM ( thePlayer, matchingDimension ) local playerTeam = getPlayerTeam if ( playerTeam == Freeroam ) then if GM == 0 then setVehicleDamageProof(getPedOccupiedVehicle(player),true) outputChatBox ("GodMode Päällä!", thePlayer, 255, 0, 0) toggleControl ( thePlayer, "fire", false ) setElementData ( thePlayer, "invincible", true ) toggleControl ( thePlayer, "next_weapon", false ) toggleControl ( thePlayer, "previous_weapon", false ) setPlayerWeaponSlot ( thePlayer, 0 ) toggleControl ( thePlayer, "aim_weapon", false ) toggleControl ( thePlayer, "vehicle_fire", false ) toggleControl ( thePlayer, "vehicle_secondary_fire", false ) GM = 1 else toggleControl ( thePlayer, "fire", true ) outputChatBox ("GodMode Pois Päältä!", thePlayer, 255, 0, 0) setVehicleDamageProof(getPedOccupiedVehicle(player),false) toggleControl ( thePlayer, "next_weapon", true ) serElementData ( thePlayer,"incincible", false ) toggleControl ( thePlayer, "previous_weapon", true ) toggleControl ( thePlayer, "aim_weapon", true ) toggleControl ( thePlayer, "vehicle_fire", true ) toggleControl ( thePlayer, "vehicle_secondary_fire", true ) GM = 0 end else outputChatBox ("TEAM:in täytyy olla Freeroam!", thePlayer, 255, 0, 0) end function toggleGM ( source ) local playerTeam = getPlayerTeam if ( playerTeam == freeroam ) then if GM == 0 then outputChatBox ("GM kytkeytyy päälle 10s päästä!", source, 255, 0, 0) setTimer ( freeroamGM, 10000, 1 ) else outputChatBox ("GM kytkeytyy pois 10s päästä!", source, 255, 0, 0) setTimer ( freeroamGM, 10000, 1 ) end else setTimer ( freeroamGM , 50, 1 ) end end end addCommandHandler ( "GM", toggleGM ) --[[addCommandHandler ( "FGM", toggleGM ) addCommandHandler ( "FreeroamGM", toggleGM )--]] client: addEventHandler ( "onClientPlayerDamage",root, function () if getElementData(source,"invincible") then cancelEvent() end end) addEventHandler("onClientPlayerStealthKill",localPlayer, function (targetPlayer) if getElementData(targetPlayer,"invincible") then cancelEvent() end end) Link to comment
CourtezBoi Posted July 19, 2013 Share Posted July 19, 2013 What is wrong with the script? Does it give you any errors or such? Link to comment
Sande Posted July 19, 2013 Author Share Posted July 19, 2013 Bad ARgument 2 in commandhandler onLine 50 Link to comment
Sande Posted July 19, 2013 Author Share Posted July 19, 2013 The function toggleGM is broken, the script not find it... Link to comment
Blaawee Posted July 20, 2013 Share Posted July 20, 2013 Read more about addCommandHandler 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