Jump to content

Szukam Skryptu


Recommended Posts

Number 2 :

meta.xml :

  
<meta> 
    <info author="Maciej 'MACIEKW89' Wituszyński" type="script" version="1.0"/> 
         <script src="c.lua" type="client"/> 
         <script src="s.lua" type="server"/> 
</meta> 
  

c.lua :

  
addEventHandler("onClientPlayerDamage",root, 
function() 
    if getElementData(source,"godmode") then 
        cancelEvent() 
    end 
end) 
  
addEventHandler("onClientPlayerStealthKill",localPlayer, 
function (targetPlayer) 
    if getElementData(targetPlayer,"godmode") then 
        cancelEvent() 
    end 
end) 

s.lua :

  
addCommandHandler("godmode", 
function(thePlayer) 
    local account = getPlayerAccount (thePlayer) 
    if (not account or isGuestAccount(account)) then 
        return 
    end 
  
    local accountName = getAccountName(account) 
    if (isObjectInACLGroup("user."..accountName, aclGetGroup("Admin"))) then 
        local state = (not getElementData(thePlayer, "godmode")) 
        setElementData(thePlayer, "godmode", state) 
    end 
end) 
  

Co do pierwszego to troszkę więcej pisania, a ja niestety leniwy jestem ;b. Nie testowane, robione na szybko. Mam nadzieję, że pomogłem.

Link to comment
  • 1 month later...

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