Jump to content

Ayuda con Admin


Julian09123

Recommended Posts

Posted

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) 
  

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

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

430x73.png

430x73.png

Posted

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) 

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

"onPlayerDamage" no se puede cancelar ( como dice en la pagina de la wiki ).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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 ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Aca si funciona.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

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