0 Üye ve 1 Ziyaretçi konuyu incelemekte.
addCommandHandler("tkt",function(oyuncu) exports["SIDECHAT_SCRİPTİNİN_İSMİ_BURAYA"]:outputSideChat(getPlayerName(oyuncu).." Türk Komando Timi Karargah'ına Işınlandı",root,255,0,0)end)
--[[+----------------------------------------------------------------------------| Dx Side Chat Script| ========================================| by MrTasty| (c) 2012-2014 | Creative Commons 3.0| http://creativecommons.org/licenses/by/3.0/| ========================================+-----------------------------------------------------------------------------| You are allowed to adapt, copy, redistribute this script.| You are not allowed to remove the original author of this script.+-----------------------------------------------------------------------------]]--function outputSideChat(message, to, r, g, b) triggerClientEvent(to or root, "onSCMessageSend", root, string.format("#%.2X%.2X%.2X", r,g,b)..message)end-- ADVANCED EXAMPLE | /scSay <message | use ~ to toggle golden colour>-- "~" replaces "|c%%%%|" (from BF2 engine, used in BFH and BFP4F) | * % = Wildcardfunction subString(str,chunkSize) if not str or type(str) ~= "string" or not chunkSize or type(chunkSize) ~= "number" then return false end local returnTable = {} while #str >= chunkSize do table.insert(returnTable,str:sub(1,chunkSize)) str = str:sub(chunkSize+1) if #str < chunkSize then table.insert(returnTable,str) end end return returnTableendfunction getTextColorAtEnd(text) local text = text:reverse() if text:find("%x%x%x%x%x%x#") then local sp, ep = text:find("%x%x%x%x%x%x#") return text:sub(sp, ep):reverse() or false endendfunction adminSay(pla, cmd, ...) local message = {...} local messageText = table.concat(message, " ") while messageText:find("#%x%x%x%x%x%x") do messageText = messageText:gsub("#%x%x%x%x%x%x", "") end local message2 = subString(messageText,1) for k, v in ipairs(message2) do if v == "~" then local messageText = table.concat(message2, "") local color = getTextColorAtEnd(messageText) if color and color == "#ffd000" then message2[k] = "#32ff64" else message2[k] = "#ffd000" end end end local messageText = table.concat(message2, "") if messageText and #messageText > 0 then else return end local name = getPlayerName(pla) repeat name = name:gsub("#%x%x%x%x%x%x", "") until not name:find("#%x%x%x%x%x%x") triggerClientEvent(root, "onSCMessageSend", root, "#32ff64"..name.."#32ff64: "..messageText)endaddCommandHandler("scSay", adminSay)
--[[+----------------------------------------------------------------------------| Dx Side Chat Script| ========================================| by MrTasty| (c) 2012-2014 | Creative Commons 3.0| http://creativecommons.org/licenses/by/3.0/| ========================================+-----------------------------------------------------------------------------| You are allowed to adapt, copy, redistribute this script.| You are not allowed to remove the original author of this script.+-----------------------------------------------------------------------------]]--function outputSideChat(message, r, g, b) triggerEvent("onSCMessageSend", root, string.format("#%.2X%.2X%.2X", r,g,b)..message)end--The Actual Code | Do not modify unless you know what you're doing--local sx,sy = guiGetScreenSize ()local scState = truelocal maxLines = 8local oocMessages = {}local font = "default-bold" --chatData["chat_font"]addEventHandler ("onClientRender",getRootElement(), function () if isPlayerHudComponentVisible ("radar") then if scState then local chatData = getChatboxLayout() local _,scale = chatData["chat_scale"] local bg = {chatData["chat_color"]} local color = --[[{205,205,205,255}]] chatData["chat_text_color"] local lines = chatData["chat_lines"] local chatX,chatY = 0.015625*sx,16 + 15*lines + 25 for k,v in ipairs(oocMessages) do local tx,ty = chatX,chatY + (maxLines+1)*15 - k*15 local vNC = v repeat vNC = vNC:gsub("#%x%x%x%x%x%x", "") until not vNC:find("#%x%x%x%x%x%x") dxDrawText (vNC,tx+1,ty+1,0,0,tocolor(0,0,0,255),1,font,"left","top",false,false,false,false) dxDrawText (v,tx,ty,0,0,tocolor(color[1],color[2],color[3],color[4]),1,font,"left","top",false,false,false,true) end end end end)addEvent ("onSCMessageSend",true)addEventHandler ("onSCMessageSend",getRootElement(), function (message) if message then local length = #oocMessages if #oocMessages >= maxLines then table.remove (oocMessages,maxLines) end local text = message table.insert (oocMessages,1,text) local textNC = text repeat textNC = textNC:gsub("#%x%x%x%x%x%x", "") until not textNC:find("#%x%x%x%x%x%x") outputConsole (textNC) if removeMssagesTimer and isTimer(removeMssagesTimer) then killTimer(removeMssagesTimer) end removeMssagesTimer = setTimer(function() oocMessages = {} end, 50000, 1) end end)function isOOCChatToggled () return scStateendfunction toggleSideChat (state) if state ~= scState then scState = state endendfunction togOOCCMD (cname,arg) if arg:lower() == "sidechat" or arg:lower() == "sc" then toggleSideChat (not scState) endend--addCommandHandler ("tog",togOOCCMD)--addCommandHandler ("toggle",togOOCCMD)