Jump to content

outputchatbox


Recommended Posts

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),  
function ( )  
  for index,player in ipairs(getElementsByType("player")) do 
    bindKey( player,"m","down", "chatbox", "CustomChat" ) 
  end 
end 
) 
  
addEventHandler("onPlayerJoin", getRootElement(),  
function ( ) 
    bindKey( source,"m","down", "chatbox", "CustomChat" ) 
end 
) 
  
addCommandHandler("CustomChat",  
function (element, _, ...) 
  local r,g,b = math.random(255),math.random(255),math.random(255) 
  local PlayerName = getPlayerName(element) 
  local message = table.concat(arg, " ") 
  for _,player in ipairs(getElementsByType("player")) do 
      outputChatBox("CustomChat : " .. tostring(PlayerName) .. ": " .. tostring(message), player,r,g,b) 
    end 
  end 
) 

لم يتم التجربة .. سيرفر

Link to comment
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),  
function ( )  
  for index,player in ipairs(getElementsByType("player")) do 
    bindKey( player,"m","down", "chatbox", "CustomChat" ) 
  end 
end 
) 
  
addEventHandler("onPlayerJoin", getRootElement(),  
function ( ) 
    bindKey( source,"m","down", "chatbox", "CustomChat" ) 
end 
) 
  
addCommandHandler("CustomChat",  
function (element, _, ...) 
  local r,g,b = math.random(255),math.random(255),math.random(255) 
  local PlayerName = getPlayerName(element) 
  local message = table.concat(arg, " ") 
  for _,player in ipairs(getElementsByType("player")) do 
      outputChatBox("CustomChat : " .. tostring(PlayerName) .. ": " .. tostring(message), player,r,g,b) 
    end 
  end 
) 

لم يتم التجربة .. سيرفر

table.concat(arg, " ") 

arg ??!

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),  
function ( )  
  for index,player in ipairs(getElementsByType("player")) do 
    bindKey( player,"m","down", "chatbox", "CustomChat" ) 
  end 
end 
) 
  
addEventHandler("onPlayerJoin", getRootElement(),  
function ( ) 
    bindKey( source,"m","down", "chatbox", "CustomChat" ) 
end 
) 
  
addCommandHandler("CustomChat",  
function (element, _, ...) 
  local r,g,b = math.random(255),math.random(255),math.random(255) 
  local PlayerName = getPlayerName(element) 
  local message = table.concat( { ... }, " " ); 
  for _,player in ipairs(getElementsByType("player")) do 
      outputChatBox("CustomChat : " .. tostring(PlayerName) .. ": " .. tostring(message), player,r,g,b) 
    end 
  end 
) 

Link to comment
table.concat(arg, " ") 

arg ??!

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()),  
function ( )  
  for index,player in ipairs(getElementsByType("player")) do 
    bindKey( player,"m","down", "chatbox", "CustomChat" ) 
  end 
end 
) 
  
addEventHandler("onPlayerJoin", getRootElement(),  
function ( ) 
    bindKey( source,"m","down", "chatbox", "CustomChat" ) 
end 
) 
  
addCommandHandler("CustomChat",  
function (element, _, ...) 
  local r,g,b = math.random(255),math.random(255),math.random(255) 
  local PlayerName = getPlayerName(element) 
  local message = table.concat( { ... }, " " ); 
  for _,player in ipairs(getElementsByType("player")) do 
      outputChatBox("CustomChat : " .. tostring(PlayerName) .. ": " .. tostring(message), player,r,g,b) 
    end 
  end 
) 

ماله داعي تجيبهم من الجدول

getRootElement ( ) -- كآفي

Link to comment
for _,player in ipairs(getElementsByType("player")) do 
    outputChatBox("CustomChat : " .. tostring(PlayerName) .. ": " .. tostring(message), player,r,g,b) 
end 

outputChatBox ( "CustomChat : " ..PlayerName.. ": " ..message, root, r, g, b ) 

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