Jump to content

Freeroam GM script [HELP]


Sande

Recommended Posts

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

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