Jump to content

[Server] Caracteres


Minez

Recommended Posts

Buenas soy nuevo en esto del Script, estaba creando un simple script para solos los admin es decir, un comando para enviar un mensaje a todo el servidor.

function msg(source,cmd,...)
    local cuenta = getAccountName(getPlayerAccount(source))
    local nombre = getPlayerName(source)
     mensaje = table.concat( {...}," ")

    if isObjectInACLGroup("user."..cuenta,aclGetGroup("Admin")) then

     outputChatBox("#00FF00"..nombre.." #00FF00dice: #FDFEFE"..""..mensaje..".",root,255,255,0,true)
 else
     outputChatBox("No eres Admin")
       end
end
addCommandHandler("d",msg)

El problema es cuando solo se escribe el comando /d, envia el mensaje sin texto en blanco, ¿cómo podría poner un limite para que a fuerza pusiera mas de 3 caracteres y se enviara el mensaje?

Link to comment
function msg(source,cmd,...)
    local cuenta = getAccountName(getPlayerAccount(source))
    local nombre = getPlayerName ( source ):gsub ( '#%x%x%x%x%x%x', '' )
     mensaje = table.concat ( { ... }, " " )
    if not ... end not mensaje then
		return outputChatBox ( "Syntax: /"..cmd.." [Texto]", source, 255, 255, 0 )
	end
    if isObjectInACLGroup("user."..cuenta,aclGetGroup("Admin")) then
        outputChatBox("#00FF00"..nombre.." #00FF00dice: #FDFEFE"..""..mensaje..".",root,255,255,0,true)
    else
        outputChatBox("No eres Admin")
    end
end
addCommandHandler("d",msg)

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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