Jump to content

Ayuda con Admin


Julian09123

Recommended Posts

usa el extra_health

function godmode(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
exports.extra_health:setElementInvulnerable(source, true) 
    end 
end 
addCommandHandler("godmode", godmode) 
  

Link to comment
usa el extra_health
function godmode(thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
exports.extra_health:setElementInvulnerable(source, true) 
    end 
end 
addCommandHandler("godmode", godmode) 
  

Si no me equivoco, eso solo lo inicia, pero no lo quita.Creo que es mejor ponerle un evento.

Link to comment

Probalo asi!

function adm ( attacker, thePlayer ) 
     local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if ( getElementType ( attacker ) == "player" ) then 
         local accName = getAccountName ( getPlayerAccount ( thePlayer ) )  
         if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
         cancelEvent() 
         end 
     end 
end 
addEventHandler("onPlayerDamage", getRootElement(), adm) 

Link to comment

Si, pero ese evento es server side.

@Plate: 'source' no esta definido, tenias que usar 'thePlayer'.

function godmode ( thePlayer ) 
    local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
    if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then 
        exports.extra_health:setElementInvulnerable ( thePlayer, not exports.extra_health:isElementInvulnerable ( thePlayer ) ) 
    end 
end 
addCommandHandler ( "godmode", godmode ) 

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...