Jump to content

Recommended Posts

local sx,sy = guiGetScreenSize ()
local chatData = getChatboxLayout()
local x, y = sx/2-50, sy-180
local oocState = true
local maxLines = 9
local oocMessages = {}
local font = "default-bold"
local _,scale = chatData["chat_scale"]
local bg = {chatData["chat_color"]}
local lines = chatData["chat_lines"]
-- local chatX,chatY = x,y
local chatX,chatY = 0.015625*sx,16 + 15*lines + 25

addEventHandler ("onClientRender",getRootElement(),
	function ()
		if getElementData(localPlayer, "loggedin") then
			if oocState and getElementData(localPlayer, "enableall") then
				chatX, chatY = exports.sas_hud:getNode(11, "x"), exports.sas_hud:getNode(11, "y")
				dxDrawText("OOC Chat (Kikapcsoláshoz /togooc | Takarítás: /co)",chatX+1,chatY+1,0,0,tocolor(0,0,0),1,font)
				dxDrawText("OOC Chat (Kikapcsoláshoz /togooc | Takarítás: /co)",chatX,chatY,0,0,tocolor(205,205,205),1,font)
				for k,v in ipairs(oocMessages) do
					local tx,ty = chatX,chatY + (maxLines+2)*15 - k*15
					dxDrawText(v,tx+1,ty+1,0,0,tocolor(0,0,0),1,font)
					dxDrawText(v,tx,ty,0,0,tocolor(205,205,205),1,font)
				end
			end
		end
	end
)

addEvent ("onOOCMessageSend",true)
addEventHandler ("onOOCMessageSend",getRootElement(),
	function (message)
		local player = source
		local int,dim = getElementInterior (player),getElementDimension(player)
		if int == getElementInterior(localPlayer) and dim == getElementDimension(localPlayer) then
			local length = #oocMessages
			if #oocMessages >= maxLines then
				table.remove (oocMessages,maxLines)
			end
			local text = message
			table.insert (oocMessages,1,text)
			outputConsole ("[OOC]"..text)
		end
	end
)

sziasztok azt szeretném megcsinálni hogy ooc-chat-en az adminnak mutatssa a színét/rangját pl

((SzuperAdmin Fory: példa))

és az ooc egybe van az ic-chattal 3 lua van.

server.lua

ooc.lua

client.lua

hogy tudnám oda be írni azt hogy ha adminszoliba vagyok, vagy nem vagyok adminszoliba, de színes a ooc ((SzuperAdmin Fory: példa))

a fenti az az ooc.lua

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