Jump to content

Problema con Globalchat Dayz


Chaky

Recommended Posts

Hola miren tengo un problema con mi globalchat en mi servidor Dayz al loguear no se puede usar almenos que se reinicie el script la verdad ya trate y no se que este :S agradeceria todo tipo de ayuda aca les dejo el script

  
function globalMessage(thePlayer, cmd, ...) 
        local message = table.concat ( { ... }, " " ); 
        local name = getPlayerName(thePlayer); 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#ff0000*[ADMIN]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        end 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
        outputChatBox("#000fff*[sMOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        end 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then 
        outputChatBox("#ffff00*[VIP]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        end 
          
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00ff00*[MOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
       else 
        outputChatBox("#123456[Global]#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
               return 
         end 
    end 
    addCommandHandler("global",  globalMessage); 
      
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
        for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"x", "down", "chatbox", "global"); 
        end 
    end) 
  

Link to comment

Debias usar 'onPlayerJoin' para poder bindear la tecla, el codigo en sí esta bien pero olvidaste agregar el 'bindKey' a la hora de entrar.

function globalMessage(thePlayer, cmd, ...) 
        local message = table.concat ( { ... }, " " ); 
        local name = getPlayerName(thePlayer); 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Admin")) then 
        outputChatBox("#ff0000*[ADMIN]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        end 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then 
        outputChatBox("#000fff*[sMOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        end 
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("VIP")) then 
        outputChatBox("#ffff00*[VIP]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
        else 
        end 
          
        local account = getAccountName ( getPlayerAccount ( thePlayer ) ) 
        if isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then 
        outputChatBox("#00ff00*[MOD]*#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
             return 
       else 
        outputChatBox("#123456[Global]#FFFFFF"..name..": #FFFFFF"..message,root, 255, 255, 255, true) 
               return 
         end 
    end 
    addCommandHandler("global",  globalMessage) 
      
    addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), function() 
        for index,player in pairs(getElementsByType("player")) do 
            bindKey(player,"x", "down", "chatbox", "global") 
        end 
    end) 
     
    addEventHandler("onPlayerJoin", root,function() 
        bindKey(source, "x", "down", "chatbox", "global") 
    end) 

Link to comment
  • Recently Browsing   0 members

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