Jump to content

APORTE : GLOBAL BASICO PARA MTA DAYZ


Recommended Posts

Server -Side

antispam = false 
function mensajeglobal ( source, cmd, ... ) 
if antispam then  
outputChatBox ( "#FF0000[Global]: #FFFFFFEspera Un Segundo Para Enviar Otro Mensaje.",source, 255,0,0,true) 
return  
end 
antispam = true 
setTimer(function() antispam = false end, 1000, 1) 
local msg = table.concat ( {...} , " " )  
local msg = string.gsub ( msg, '#%x%x%x%x%x%x', '' ) 
local nombre = getPlayerName(source)     
    local onlyLettersMsg = string.gsub ( msg , "%A", "" )  
    if onlyLettersMsg == string.upper ( onlyLettersMsg ) and #onlyLettersMsg > 0 then  
    outputChatBox ( "#FF0000[Global]: #FFFFFFNo Uses Mayúsculas.",source, 255,0,0,true) 
    return 
    end 
    if string.find ( msg, "http://" )  then 
    outputChatBox ( "#FF0000[Global]: #FFFFFFNo Publiques Links.",source, 255,0,0,true) 
    return 
    end  
    if string.find ( msg, "mtasa://" ) then 
    outputChatBox ( "#FF0000[Global]: #FFFFFFNo Publiques Ip's.", source,255,0,0,true) 
    return 
    end 
    if string.find ( msg, "mierda" ) or string.find ( msg,"shit") or string.find ( msg,"noob")  then  
    outputChatBox ( "#FF0000[Global]: #FFFFFFNo Insultos.",source,255,0,0,true) 
    return 
    end  
    if isPlayerMuted ( source ) then  
    outputChatBox ( "#FF0000[Global]: #FFFFFFEstas Muteado.",source,255,0,0,true) 
    return 
    end 
    local var, spacesCount = string.gsub( msg, " ", "")  
    if ( #msg / spacesCount ) > 20 and #msg > 20 then  
    outputChatBox ( "#FF0000[Global]: #FFFFFFNo Uses Palabras Grandes.",source,255,0,0,true) 
    return 
    end 
    local mensaje = table.concat ( { ... }, " " ) 
    local nivel  = getElementData (source,"level") 
    local clan = getElementData(source, "gang" ) 
    local vida = getElementData(source, "blood") 
    local nombre = getPlayerName(source) 
    local registro = getPlayerAccount( source ) 
    local cuenta =  getAccountName(registro) 
     
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Admin" ) ) then 
       outputChatBox("#5EAADE["..clan.."] #FF0000[Administrador] #FDFDFD"..nombre..": #FDFDFD"..mensaje, getRootElement(), 255, 255, 255, true)  
    return 
    end 
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "SuperModerator" ) ) then 
        outputChatBox("#5EAADE["..clan.."] #91DF2D[superMod] "..nombre..": #FDFDFD"..mensaje, getRootElement(), 255, 255, 255, true) 
    return 
    end 
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Moderator" ) ) then 
        outputChatBox("#5EAADE["..clan.."] #0E7C3E[Moderador 1] "..nombre..": #FDFDFD"..mensaje, getRootElement(), 255, 255, 255, true) 
    return 
    end  
     
    if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Everyone" ) ) then 
       outputChatBox("#FF0000[Global]"..nombre..": #FDFDFD"..mensaje, getRootElement(), 255, 255, 255, true) 
    return 
    end   
     
end 
  
addCommandHandler("Global", mensajeglobal) 
  
  
  
function ChatInicio() 
         outputChatBox("Presiona [X] para usar el Chat Global", source, 255, 0, 0) 
end 
addEventHandler("onPlayerLogin", root, ChatInicio) 
  
  

Client-Side

bindKey("x", "down", "chatbox", "Global") 
  

Link to comment
  • Recently Browsing   0 members

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