Jump to content

outPutChatBox


Recommended Posts

Hey i use This Resources , which allow me to Send Message to all players i need just help in . Like i /shout Hello

ineed to outPutChatBox Hello

and i need getPlayerName like if some one called Carmen Shouted it seems like that Carmen : Hello

this shout belongs to SolidSnake

function shout(player, cmd, ...) 
local accountname = getAccountName(getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))  then 
for id, players in ipairs(getElementsByType("player")) do 
local message = table.concat({...}," ") 
local textDisplay = textCreateDisplay () 
local nombre = getPlayerName(player) 
local textItem = textCreateTextItem( ""..message, 0.5, 0.5, 2, 205, 0, 0, 255, 3, "center", "center" ) 
textDisplayAddText ( textDisplay, textItem ) 
textDisplayAddObserver ( textDisplay, players ) 
setTimer ( textDestroyTextItem, 5000, 1, textItem ) 
setTimer ( textDestroyDisplay, 5000, 1, textDisplay ) 
end 
else 
outputChatBox("You cannot use this command!",player,255,12,15) 
    end 
end 
  
addCommandHandler("shout", shout) 

Link to comment

Hello, I have a small issue with the function outputChatBox.

Following the example of a wiki i done like that:

 outputChatBox ("#FF0000Hello # 00FF00World", getRootElement (), 255, 255, 255, true)  

And the output should be Hello World , but I get the "#FF0000Hello #00FF00World" .

Trying more options

 outputChatBox ("Red #FFFFFF: White", 255, 0, 0)  

I got Red #FFFFFF: White .

How should I do, to get red White ?

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