Jump to content

Snoop.Cat

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by Snoop.Cat

  1. hello i want to enable the cursor when i thype the comand /chatop and when close gui disable it how i can do it ? this is smartchat resource , plz help local extension = f_createChatPlugin("Options") local window,optionstab,layouttab,width,height,h,highest addCommandHandler("resetsmartchat", function () f_resetChatBoxSettings() end ) addCommandHandler("chatop", function () width = 500 h = dxGetFontHeight()*1.6 height = h createGui() end ) addCommandHandler("smartchat", function () setTimer(function () f_setChatBoxSetting("settings.enablesmartchat",not settings.enablesmartchat) f_saveChatBoxSettings() end,500,1) end ) addEvent("onChatExtensionStart") addEventHandler("onChatExtensionStart",extension, function (tab) width = 500 h = dxGetFontHeight()*1.6 height = h createGui() destroyElement(tab) end ) function createGui () if window and isElement(window) then return false end window = guiCreateWindow(0,0,800,600,"Smartchat Options",false) guiSetAlpha(window,1) guiWindowSetSizable(window,false) tabpanel = guiCreateTabPanel(0,h,700,500,false,window) -- layout local highest = 0 for part,info in pairs (layout) do local tab = guiCreateTab(longstring(part),tabpanel) if part == "general" then for setting,value in pairs (settings) do createOption(longstring(setting),tab,value,"settings."..setting) end end for subpart,value in pairs (info) do if subpart == "size" then createOption("Width",tab,value.x,"layout."..part.."."..subpart..".x") createOption("Height",tab,value.y,"layout."..part.."."..subpart..".y") elseif subpart == "pos" then createOption("Left",tab,value.x,"layout."..part.."."..subpart..".x") createOption("Top",tab,value.y,"layout."..part.."."..subpart..".y") elseif string.find(subpart,"font") then createOption("Font",tab,value.name,"layout."..part.."."..subpart..".name") createOption("Font Scale",tab,value.scale,"layout."..part.."."..subpart..".scale") createOption("Font Color",tab,value.color,"layout."..part.."."..subpart..".color") else createOption(longstring(subpart),tab,value,"layout."..part.."."..subpart) end end if height > highest then highest = height end height = h end -- resize height = highest local w = (width-40)/3 guiSetSize(window,width,height+4*h,false) guiSetSize(tabpanel,width,highest+1.5*h,false) guiSetPosition(window,(screenX/2)-(width/2),(screenY/2)-((highest+4*h)/2),false) -- buttons height = highest+3*h addEventHandler("onClientGUIClick",createButton("Ok",10,w,window),function (btn,state) if state == "up" and btn == "left" then f_saveChatBoxSettings() destroyElement(window) end end,false) addEventHandler("onClientGUIClick",createButton("Cancel",20+w,w,window),function (btn,state) if state == "up" and btn == "left" then destroyElement(window) f_loadChatBoxSettings() end end,false) applybutton = createButton("Apply",30+2*w,w,window) guiSetEnabled(applybutton,false) addEventHandler("onClientGUIClick",applybutton,function (btn,state) if state == "up" and btn == "left" then f_saveChatBoxSettings() guiSetEnabled(applybutton,false) end end,false) end addEventHandler("onClientGUIClick",root, function (key,state) if key ~= "left" or state ~= "up" then return end local table = getElementData(source,"smartchat.table") if table then if getElementType(source) == "gui-checkbox" then f_setChatBoxSetting(table,guiCheckBoxGetSelected(source)) guiSetEnabled(applybutton,true) elseif getElementType(source) == "gui-button" then guiSetText(source,"press any key") currentbutton = source currenttable = table addEventHandler("onClientKey",root,onKeyChange) end end local default = getElementData(source,"smartchat.default") if default then local value = f_getChatBoxSetting(string.gsub(string.gsub(default,"settings","defaultsettings"),"layout","defaultlayout")) f_setChatBoxSetting(default,value) local gui = getElementData(source,"smartchat.gui") if gui then if getElementType(gui) == "gui-checkbox" then guiCheckBoxSetSelected(gui,value) elseif type(value) == "number" and getElementType(gui) == "gui-button" then guiSetProperty(gui,"NormalTextColour",string.upper(string.sub(fromColor(value,true),2))) guiSetProperty(gui,"PushedTextColour",string.upper(string.sub(fromColor(value,true),2))) else guiSetText(gui,value) end guiSetEnabled(applybutton,true) end end local table = getElementData(source,"smartchat.color") if table then local window = guiCreateWindow((screenX/2)-188,(screenY/2)-80,375,185,"color",false) guiWindowSetSizable(window,false) guiWindowSetMovable(window,false) guiSetAlpha(window,1) guiCreateLabel(10,30,40,15,"Red:",false,window) guiCreateLabel(10,60,40,15,"Green:",false,window) guiCreateLabel(10,90,40,15,"Blue:",false,window) guiCreateLabel(10,120,40,15,"Alpha:",false,window) local gr = guiCreateScrollBar(50,30,200,15,true,false,window) local gg = guiCreateScrollBar(50,60,200,15,true,false,window) local gb = guiCreateScrollBar(50,90,200,15,true,false,window) local ga = guiCreateScrollBar(50,120,200,15,true,false,window) local r,g,b,a = fromColor(f_getChatBoxSetting(table),false) guiScrollBarSetScrollPosition(gr,r/2.5) guiScrollBarSetScrollPosition(gg,g/2.5) guiScrollBarSetScrollPosition(gb,b/2.5) guiScrollBarSetScrollPosition(ga,a/2.5) guiSetEnabled(applybutton,true) local oldsource = source function onRender () local r = guiScrollBarGetScrollPosition(gr)*2.5 local g = guiScrollBarGetScrollPosition(gg)*2.5 local b = guiScrollBarGetScrollPosition(gb)*2.5 local a = guiScrollBarGetScrollPosition(ga)*2.5 dxDrawRectangle((screenX/2)+73,(screenY/2)-50,105,105,tocolor(r,g,b,a),true) f_setChatBoxSetting(table,tocolor(r,g,b,a)) guiSetProperty(oldsource,"NormalTextColour",string.upper(string.format("%.2X%.2X%.2X%.2X",a,r,g,b))) guiSetProperty(oldsource,"PushedTextColour",string.upper(string.format("%.2X%.2X%.2X%.2X",a,r,g,b))) end addEventHandler("onClientRender",root,onRender) local button = guiCreateButton(153,143,70,30,"Close",false,window) addEventHandler("onClientGUIClick",button, function () removeEventHandler("onClientRender",root,onRender) destroyElement(window) end ) end end,true ) addEventHandler("onClientGUIChanged",root, function () local table = getElementData(source,"smartchat.table") if table then if tonumber(guiGetText(source)) then f_setChatBoxSetting(table,tonumber(guiGetText(source))) guiSetEnabled(applybutton,true) end end end ) addEventHandler("onClientGUIComboBoxAccepted",root, function (box) local table = getElementData(source,"smartchat.table") if table then f_setChatBoxSetting(table,fonts[guiComboBoxGetItemText(box,guiComboBoxGetSelected(box))]) guiSetEnabled(applybutton,true) end end ) function onKeyChange (key,pressing) if pressing then return end f_setChatBoxSetting(currenttable,key) guiSetText(currentbutton,key) currenttable = nil currentbutton = nil guiSetEnabled(applybutton,true) removeEventHandler("onClientKey",root,onKeyChange) end function createOption (name,parent,value,gtable) local name = longstring(name) local w1,w2,w3 = dxGetTextWidth(name),0,dxGetTextWidth("default")*1.2 local label = guiCreateLabel(30,height,w1,h,name,false,parent) guiLabelSetHorizontalAlign(label,"center") guiLabelSetVerticalAlign(label,"center") local child if type(value) == "boolean" then w2 = 10 child = guiCreateCheckBox(40+w1,height,20,h,"",value,false,parent) setElementData(child,"smartchat.table",gtable) elseif string.find(name,"Key") then w2 = dxGetTextWidth("press any key")*1.1 child = guiCreateButton(40+w1,height,w2,h,tostring(value),false,parent) setElementData(child,"smartchat.table",gtable) elseif name == "Width" or name == "Height" or name == "Lines" or gettok(name,2," ") == "Scale" or name == "Left" or name == "Top" then w2 = 50 child = guiCreateEdit(40+w1,height,w2,h,tostring(value),false,parent) setElementData(child,"smartchat.table",gtable) elseif name == "Font" or gettok(name,2," ") == "Font" then w2 = 150 child = guiCreateComboBox(40+w1,height,w2,7*h,"",false,parent) for font,name in pairs (fonts) do local item = guiComboBoxAddItem(child,font) if name == value then guiComboBoxSetSelected(child,item) end end setElementData(child,"smartchat.table",gtable) elseif string.find(name,"Color") then w2 = 30 child = guiCreateButton(40+w1,height,w2,h,"▉",false,parent) guiSetProperty(child,"NormalTextColour",string.upper(string.sub(fromColor(value,true),2))) guiSetProperty(child,"PushedTextColour",string.upper(string.sub(fromColor(value,true),2))) setElementData(child,"smartchat.color",gtable) elseif type(value) == "table" then local text = table.concat(value,", ") guiLabelSetVerticalAlign(guiCreateLabel(40+w1,height,dxGetTextWidth(text),h,text,false,parent),"center") end if child then local defaultbutton = guiCreateButton(50+w1+w2,height,w3,h,"default",false,parent) setElementData(defaultbutton,"smartchat.default",gtable) setElementData(defaultbutton,"smartchat.gui",child) end height=height+h end function createButton (string,start,width,parent) return guiCreateButton(start,height,width,h,string,false,parent) end local replace = { ["nickcompletion"]="Nick Completion",
  2. okay , now i disabled script and cant enable it again cuz there is no bind to enter chat settings u.u
  3. thx castillo im soo stupid , how i didn't tryied...another question , how do i enable mouse?
  4. hey guys i have a problem installing a resource , yes its the new chat system , https://community.multitheftauto.com/ind ... 380&vote=5 i dont know where and how to add the functions - function.executeCommandHandler - function.callRemote and when i start resource it says error startup canceled by the script. thx for help
  5. hey i have a problem whit my userpanel , the panel is not showing the players won stats , this are the codes: tab_client.lua: guiSetText ( wonStatsLabel, ddswon.."("..round(ddswon/(ddsplayed/100)).."%)") local ddswon = tonumber(getElementData(player,"ddswon")) core_client.lua local wintext = string.gsub(wintext,"WON",getElementData(source,"ddswon")) core_server.lua local dataTable = { "cash", "cashearned", "cashspent", "deaths", "toptimes12", "distancetravelled", "racesplayed", "ddsplayed", "ddswon", "lastseen", "playtime", "level", "jointimes", "mapsfinished", "funareakills", } local ddswon = tonumber(getAccountData(account,"ddswon")) addEvent("onPlayerDestructionDerbyWin",true) addEventHandler("onPlayerDestructionDerbyWin",getRootElement(), function () destroyElement(playerblip[source]) activePlayers = getElementsByType("player") --Win as last survivor (saver than old method) local account = getPlayerAccount(source) if not (isGuestAccount(account)) then local cash,summeWithLevel = calcCash(1,source) outputChatBox("#FFFFFF"..getPlayerName(source).." #FF6347earned #FFFFFF"..tostring(cash).."$",getRootElement(),unpack(scriptcol[1])) addStat(account,"ddsplayed",1) addStat(account,"ddswon",1) addStat(account,"cash",cash + summeWithLevel) else outputChatBox("#FFFFFF"..getPlayerName(source).." #FF6347won as last player alive!",getRootElement(),unpack(scriptcol[1])) end allTopValues = { "playtime", "cash", "ddsplayed", "ddswon", "deaths", "level", "toptimes12", "mapsfinished", "funareakills", } this is all i can found , is not the complete panel , if you need some of complete script to help me pm me or say here plz
  6. this scripts was uploaded by revenge to guy to another so plz delete , also uploading whitout permissions a Race: https://community.multitheftauto.com/ind ... ls&id=6303 a stunt: https://community.multitheftauto.com/ind ... ls&id=6305 dx joinquit (8Q creator ) https://community.multitheftauto.com/ind ... ls&id=6300 speedo: https://community.multitheftauto.com/ind ... ls&id=6302 DONE
  7. pues elimina el script y deveria volverse todo a como estaba antes.
  8. borra esa caga de admin2 , no sirve para mucho , yo en mi server la elimine , revisa que esten todos los archivos en em meta etc etc
  9. no se no me da confianza algen que dice q nos hostea solo si hay buenos scripts
×
×
  • Create New...