Jump to content

Hola ayuda con godmode


Mateito14

Recommended Posts

Posted

Hola estoy tratando de hacer que el godmode_esp se active automático para todos los admins sin comando :P, osea yo lo inicio pero después tengo que poner /actgod y se activa solo para mi, como ago para que cuando lo inicie ya se active?

esta asi esto

  
  
        function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Supermoderator" ) ) then 
           if getElementData(thePlayer,"invincible") then 
        setElementData(thePlayer,"invincible",false) 
        outputChatBox("God Mode Esta Ahora Deshabilitado.",thePlayer,0,255,0) 
    else 
        setElementData(thePlayer,"invincible",true) 
        outputChatBox("God Mode esta Ahora Habilitado.",thePlayer,0,255,0) 
        end 
    end 
end 
        addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el Godemode Para los Admins 
        addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el Godemode Para los Moderadores 
  
  

que le cambio?

y como le pongo para los moderadores tambien?

Posted

Intenta Esto:

function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then 
           if getElementData(thePlayer,"invincible") then 
        setElementData(thePlayer,"invincible",true) 
        outputChatBox("God Mode Esta Ahora Activado.",thePlayer,0,255,0) 
        end 
    end 
end 
addEventHandler("onResourceStart",getRootElement(), toggleGodMode) 
  

Posted
Intenta Esto:
function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( "Moderator" ) ) then 
           if getElementData(thePlayer,"invincible") then 
        setElementData(thePlayer,"invincible",true) 
        outputChatBox("God Mode Esta Ahora Activado.",thePlayer,0,255,0) 
        end 
    end 
end 
addEventHandler("onResourceStart",getRootElement(), toggleGodMode) 
  

mm nada :C

Posted
debugscript 3 ?

ehh? donde pongo eso? lo puse en la ventana negra y no me dejo en el chat me aparecio algo naranja pero en ningun lado dice dana del godmode el resource me inicia todo bien pero nose

Posted

Guíate por este resource https://community.multitheftauto.com/index.php?p=resources&s=details&id=4400, ya que eres nuevo solo edita los outputChatBox y cambias

if (hasObjectPermissionTo(thePlayer, "function.banPlayer")) then 

por

if (hasObjectPermissionTo(thePlayer, "function.mutePlayer")) then 

si lo quieres solo para los que tengan la función mute, ya sean mod, smod y admin, solo si lo quieres para aquello

PD: No estoy muy seguro del mutePlayer, pero si no te funciona publicas aquí.

Posted
Guíate por este resource https://community.multitheftauto.com/index.php?p=resources&s=details&id=4400, ya que eres nuevo solo edita los outputChatBox y cambias
if (hasObjectPermissionTo(thePlayer, "function.banPlayer")) then 

por

if (hasObjectPermissionTo(thePlayer, "function.mutePlayer")) then 

si lo quieres solo para los que tengan la función mute, ya sean mod, smod y admin, solo si lo quieres para aquello

PD: No estoy muy seguro del mutePlayer, pero si no te funciona publicas aquí.

como funcion mute?

Posted

Mira, hay eso lo de mutePlayer esta privatizando solo para los que tengan la función mute, por lo tanto si alguien no tiene esa función no podra ejecutar el comando.

Posted
Mira, hay eso lo de mutePlayer esta privatizando solo para los que tengan la función mute, por lo tanto si alguien no tiene esa función no podra ejecutar el comando.

ok pero como ago para que se active automatico?

Posted

Intenta asi:

function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        for _, group in ipairs ({"Admin", "Supermoderator"}) do 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
        if ( getElementData( thePlayer, "invicible", true ) == "No")  or ( getElementData( thePlayer, "invicible", true ) == false ) then 
        setElementData(thePlayer, "invicible", "Si") 
        outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) 
        else 
        setElementData(thePlayer, "invicible", "No") 
        outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) 
        end 
    end 
end 
end 
addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode 

Ya lo testee y funciona correctamente.

Posted
Intenta asi:
function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        for _, group in ipairs ({"Admin", "Supermoderator"}) do 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
        if ( getElementData( thePlayer, "invicible", true ) == "No")  or ( getElementData( thePlayer, "invicible", true ) == false ) then 
        setElementData(thePlayer, "invicible", "Si") 
        outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) 
        else 
        setElementData(thePlayer, "invicible", "No") 
        outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) 
        end 
    end 
end 
end 
addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode 

Ya lo testee y funciona correctamente.

nada :C nose como voy a hacer encontre uno que se incia automatico pero es para players sin admin para smod para admin para mod para todos :(

es esto nose como se edita para que sea solo para admin smod y mod

    function stopDamage ( theplayer , attacker, weapon, bodypart ) 
            cancelEvent() --cancel the event 
    end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) 

Posted

intenta agregarle esta linea:

if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("Admin")) and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SuperModerator")) then 

y al final ponle otro end

Posted
intenta agregarle esta linea:
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("Admin")) and isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SuperModerator")) then 

y al final ponle otro end

como otro end?

en donde?

xD perdona si soy tan nuevo

Posted
Intenta asi:
function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        for _, group in ipairs ({"Admin", "Supermoderator"}) do 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
        if ( getElementData( thePlayer, "invicible", true ) == "No")  or ( getElementData( thePlayer, "invicible", true ) == false ) then 
        setElementData(thePlayer, "invicible", "Si") 
        outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) 
        else 
        setElementData(thePlayer, "invicible", "No") 
        outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) 
        end 
    end 
end 
end 
addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode 

Ya lo testee y funciona correctamente.

nada :C nose como voy a hacer encontre uno que se incia automatico pero es para players sin admin para smod para admin para mod para todos

es esto nose como se edita para que sea solo para admin smod y mod

    function stopDamage ( theplayer , attacker, weapon, bodypart ) 
            cancelEvent() --cancel the event 
    end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) 

Aaaahhhh. Yo solo reparaba tu script -.-'. Intenta asi:

function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        for _, group in ipairs ({"Admin", "Supermoderator"}) do 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
        if ( getElementData( thePlayer, "invicible", true ) == "No")  or ( getElementData( thePlayer, "invicible", true ) == false ) then 
        setElementData(thePlayer, "invicible", "Si") 
        outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) 
        addEventHandler("onPlayerDamage", getRootElement(), godmode) 
        else 
        setElementData(thePlayer, "invicible", "No") 
        outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) 
        removeEventHandler("onPlayerDamage", getRootElement(), godmode) 
        end 
    end 
end 
end 
addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode 
  
function godmode() 
    cancelEvent() 
    end 

Posted
Intenta asi:
function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        for _, group in ipairs ({"Admin", "Supermoderator"}) do 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
        if ( getElementData( thePlayer, "invicible", true ) == "No")  or ( getElementData( thePlayer, "invicible", true ) == false ) then 
        setElementData(thePlayer, "invicible", "Si") 
        outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) 
        else 
        setElementData(thePlayer, "invicible", "No") 
        outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) 
        end 
    end 
end 
end 
addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode 

Ya lo testee y funciona correctamente.

nada :C nose como voy a hacer encontre uno que se incia automatico pero es para players sin admin para smod para admin para mod para todos

es esto nose como se edita para que sea solo para admin smod y mod

    function stopDamage ( theplayer , attacker, weapon, bodypart ) 
            cancelEvent() --cancel the event 
    end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) 

Aaaahhhh. Yo solo reparaba tu script -.-'. Intenta asi:

function toggleGodMode(thePlayer) 
        local account = getPlayerAccount(thePlayer) 
        if not account or isGuestAccount(account) then return end 
        local accountName = getAccountName(account) 
        for _, group in ipairs ({"Admin", "Supermoderator"}) do 
        if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
        if ( getElementData( thePlayer, "invicible", true ) == "No")  or ( getElementData( thePlayer, "invicible", true ) == false ) then 
        setElementData(thePlayer, "invicible", "Si") 
        outputChatBox("God Mode esta Ahora Habilitado.", thePlayer, 0, 255, 0) 
        addEventHandler("onPlayerDamage", getRootElement(), godmode) 
        else 
        setElementData(thePlayer, "invicible", "No") 
        outputChatBox("God Mode Esta Ahora Deshabilitado.", thePlayer, 0, 255, 0) 
        removeEventHandler("onPlayerDamage", getRootElement(), godmode) 
        end 
    end 
end 
end 
addCommandHandler("actgod",toggleGodMode) ---Para Activar o desactivar el godMode 
  
function godmode() 
    cancelEvent() 
    end 

xD me rindo :P ya fue lo activo con el comando :|

Posted

Tu quieres sin comando -.-'.

Server side:

function godmode() 
local playerAcc = getPlayerAccount(source) 
local accountName = getAccountName(playerAcc) 
for _, group in ipairs ({"Admin", "Supermoderator"}) do 
if isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( group ) ) then 
triggerClientEvent("inmortal", source) 
end 
end 
end 
addEventHandler("onPlayerLogin", getRootElement(), godmode) 

Clien Side:

addEvent("inmortal", true) 
addEventHandler("inmortal", getRootElement(), 
addEventHandler("onClientPlayerDamage", getRootElement(), 
function clientgodmode 
cancelEvent() 
end 
) 
) 

Intenta eso. Si no me rindo xD.

  • Recently Browsing   0 members

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