Jump to content

outPutChatBox


Recommended Posts

Posted

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) 

My nick in MTA is Spider

Posted

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 ?

Posted

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

look try that outputChatBox ("#FF0000Hello #FFFFFFWold",255,0,0,true)

My nick in MTA is Spider

Posted (edited)

Code Removed by Nikolai96

You must cancel the Admin panel 'shout' command as well, or you can chance the code command handler to 'shoutall'.

Edited by Guest

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

You're welcome, And i'm not your bro.

Do for me a favor & stop copying Grafuroam, be original.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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