Jump to content

TABoOoT

Members
  • Posts

    2
  • Joined

  • Last visited

Details

  • Gang
    newDev

TABoOoT's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. when i type in chat "ضض" it dosent replace it with the (png) any other ideas?
  2. hi i am a new scripter and i ran into a problem, i made a script to replace strings with emojis. my problem is the following on the client the script is local root = getRootElement() local rroot = getResourceRootElement() local sx,sy = guiGetScreenSize() local chatbox = getChatboxLayout() local y = chatbox["chat_scale"][2] local lineas = chatbox["chat_lines"] local font = "default" if chatbox["chat_font"] == 1 then font = "clear" elseif chatbox["chat_font"] == 2 then font = "default-bold" elseif chatbox["chat_font"] == 3 then font = "arial" end addEventHandler("SpecialEmojis", root,function(txt) for k,v in ipairs(getElementsByType("gui-staticimage",rroot)) do local gx,gy = guiGetPosition(v,true) if string.len(txt) > 100 then guiSetPosition(v, gx,gy-0.025,true) else guiSetPosition(v, gx,gy-0.025,true) end if gy <= 0.01 then destroyElement(v) end end txt = string.gsub(txt,"#[%x][%x][%x][%x][%x][%x]","") local len = 0 if string.len(txt) > 48 then return end if string.find(txt,"ضض") then local text = string.gsub(txt,"ضض","") local len = dxGetTextWidth(text,chatbox["chat_scale"][1],font) local lfin = convertirRelativo(len) outputDebugString("LEN="..tostring(len).." LFIN="..tostring(lfin)) local img = guiCreateStaticImage(0.01875+lfin,0.02+(0.025*(lineas-1)),0.02,0.025,"dai/3tb.png",true) end end) function convertirRelativo(x) local rx = x/sx return rx end and on server side its function dai ( ) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then triggerClientEvent ( "SpecialEmojis", source ) end end the main thing i want my script to do is to check if the player is in admin group and then when he types "ضض" in chat it replaces with an emoji which is 3tb.png thanks...
×
×
  • Create New...