Jump to content

تعديل توب شات


Recommended Posts

السلام عليكم

شباب معي مود الـ TopChat

ابيه اذا احد دخل او طلع

او انا مسوي اختصار فأي مود مثلا outputTopChat " اهلا بكم "

يجي ويختفي مو يظل

وابي اضافة عليه كل اشوي يجي كلام انا احطه

الكود

  
screenX, screenY = guiGetScreenSize() 
topChat = { 
  {"", 20, 50, 90} 
} 
  
setTimer(function() table.remove(topChat, 1) end, 6000, 0) 
setTimer(function() table.remove(topChat, 1) end, 10000, 1) 
  
  
addEventHandler("onClientPreRender",root,  
  function() 
    dxDrawRectangle(screenX/4+(screenX/10),1*20-20,screenX/2-(screenX/10),20.0,tocolor(0,0,0,150),false) 
    local x, y, z = getElementPosition(localPlayer) 
    if #topChat >= 8 then table.remove(topChat, 1) end 
    for k, v in ipairs(topChat) do 
      dxDrawRectangle(screenX/4+(screenX/10),k*20,screenX/2-(screenX/10),20.0,tocolor(0,0,0,150),false) 
dxDrawText("    "..v[1],screenX/4+(screenX/10),k*40,screenX/2-(screenX/10),20.0,tocolor(v[2],v[3],v[4],255),1.0,"default-bold","left","center",false,false,false, true) 
    end 
  end 
) 
  
function outputTopChat(message, r, g, b) 
  table.insert(topChat, { message, r, g, b }) 
  local thetime = getRealTime() 
  outputConsole("["..string.format("%.2d:%.2d:%.2d", thetime.hour, thetime.minute, thetime.second).."] "..message:gsub("#%x%x%x%x%x%x", "")) 
  setTimer(function() table.remove(topChat, 1) end, 60000, 1) 
end 
addEvent("outputTopChat", true) 
addEventHandler("outputTopChat", root, outputTopChat) 
  
  

Link to comment

-- Example 1: 
  
addEventHandler ( "onPlayerQuit", root, function ( )    
 exports["TopBarChat"]:sendClientMessage ( getPlayerName ( source ).." has left the server.", root, 255, 100, 100, true, 8 ) 
end )  
  
-- Example 2: 
addEventHandler ( "onPlayerJoin", root, function ( )    
 exports["TopBarChat"]:sendClientMessage ( getPlayerName ( source ).." has connected to the server!", root, 255, 100, 100, false, 10 ) 
end ) 
  

#Server Side

الكود هذا ﻻزم في مود بروحه ,, يعني مو في نفس المود

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