Jump to content

Fury

Members
  • Posts

    265
  • Joined

  • Last visited

Everything posted by Fury

  1. you can edit the position by yourself. it will be same position on every resolution.
  2. Fury

    top wins

    thank you so much
  3. can you show me your dx code? maybe it has a bugs? btw: x,y = guiGetScreenSize() local LabelInf1 = guiCreateLabel(50, y-200, 200, 50, "deathmatchin", false) guiLabelSetColor ( LabelInf1, 255, 255, 255 ) guiSetFont ( LabelInf1, Chino ) you can edit the position of text in here: 50, y-200
  4. x,y = guiGetScreenSize() local font = dxCreateFont("font.ttf", 10) -- or just "Chino" idk chino is mta font? local size = 1 dxDrawText ("deathmatch" ,x/2,y/2,x,y, tocolor ( 0,0,0,100 ), font, size ) you can do it with dx.
  5. Fury

    top wins

    same problem. is there a way to make "dxTable"? its drawing all in same line. and its shows all accounts not for 5.
  6. Fury

    top wins

    server: function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick" ) or getAccountName ( v ), data = getAccountData ( v, map ) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) for i = 1, 5 do newTable = { "#c0c0c0"..i.." - #abcdef"..tostring ( tableOrder [ i ].name ).." #c0c0c0- #abcdef"..tostring ( tableOrder [ i ].data )..""} triggerClientEvent ( "returnTable", getRootElement(),newTable ) end end addEventHandler ( 'onMapStarting', root, topmap) client: topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", getRootElement(), function ( newTable ) topTable = newTable setTimer(removeEventHandler,5000,1,"onClientRender", getRootElement(), yazdir) end ) local font = dxCreateFont ( "font.ttf" ) local fontsize = 1.7 local x,y = guiGetScreenSize ( ) function yazdir ( ) dxDrawImage( x-340, 20, 320, 200, "bgr.png" ) for index, top in ipairs ( topTable ) do dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, 60, 360, 40, tocolor(255,140,0), fontsize, font ) dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, 120, 360, 40, tocolor(255,140,0), fontsize, font ) dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, 180, 360, 40, tocolor(255,140,0), fontsize, font ) dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, 240, 360, 40, tocolor(255,140,0), fontsize, font ) dxDrawText ( tostring ( index ) .." - ".. top.name .." - ".. tostring ( top.data ), x-320, 300, 360, 40, tocolor(255,140,0), fontsize, font ) end end addEventHandler ( "onClientRender", getRootElement(), yazdir ) is trigger is right? im not sure about that. it has to worked
  7. Fury

    top wins

    server: function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick" ) or getAccountName ( v ), data = getAccountData ( v, map ) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) for i = 1, 5 do newTable = { "#c0c0c0"..i.." - #abcdef"..tostring ( tableOrder [ i ].name ).." #c0c0c0- #abcdef"..tostring ( tableOrder [ i ].data )..""} triggerClientEvent ( "returnTable", getRootElement(),newTable ) end end addEventHandler ( 'onMapStarting', root, topmap) client: topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", getRootElement(), function ( newTable ) topTable = newTable setTimer(removeEventHandler,5000,1,"onClientRender", getRootElement(), yazdir) end ) local font = dxCreateFont("font.ttf") local fontsize = 1.7 local x,y = guiGetScreenSize() function yazdir () dxDrawImage(x-340, 20, 320, 200, "bgr.png") dxDrawText (topTable, x-320, 60, 360, 40, tocolor(255,140,0), fontsize, font ) end addEventHandler("onClientRender", getRootElement(), yazdir)
  8. Fury

    top wins

    server: function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick" ) or getAccountName ( v ), data = getAccountData ( v, map ) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) for i = 1, 5 do newTable = { "#c0c0c0"..i.." - #abcdef"..tostring ( tableOrder [ i ].name ).." #c0c0c0- #abcdef"..tostring ( tableOrder [ i ].data )..""} triggerClientEvent ( "returnTable", newTable ) end end addEventHandler ( 'onMapStarting', root, topmap) client: topTable = { } addEvent ( "returnTable", true ) addEventHandler ( "returnTable", getRootElement(), function ( newTable ) topTable = newTable setTimer(removeEventHandler,5000,1,"onClientRender", getRootElement(), yazdir) end ) local font = dxCreateFont("font.ttf") local fontsize = 1.7 local x,y = guiGetScreenSize() function yazdir () dxDrawImage(x-340, 20, 320, 200, "bgr.png") dxDrawColoredText(topTable, x-320, 60, 360, 40, tocolor(255,140,0), fontsize, font) end addEventHandler("onClientRender", getRootElement(), yazdir) function dxDrawColoredText(str, ax, ay, bx, by, color, scale, font,left,top) local pat = "(.-)#(%x%x%x%x%x%x)" local s, e, cap, col = str:find(pat, 1) local last = 1 while s do if cap == "" and col then color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end if s ~= 1 or cap ~= "" then local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,left,top,true) ax = ax + w color = tocolor(tonumber("0x"..col:sub(1, 2)), tonumber("0x"..col:sub(3, 4)), tonumber("0x"..col:sub(5, 6)), 255) end last = e + 1 s, e, cap, col = str:find(pat, last) end if last <= #str then cap = str:sub(last) local w = dxGetTextWidth(cap, scale, font) dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,left,top,true) --end end end
  9. Fury

    top wins

    can you give me a example please?
  10. Fury

    top wins

    can you give me a example to send all table to client side and dxdraw it?
  11. Fury

    top wins

    server: function topmap( player, command ) local map = getResourceName ( exports['mapmanager']:getRunningGamemodeMap ( ) ) local tableOrder = { } for i, v in ipairs ( getAccounts ( ) ) do table.insert ( tableOrder, { name = getAccountData ( v, "nick" ) or getAccountName ( v ), data = getAccountData ( v, map ) or 0 } ) end table.sort ( tableOrder, function ( a, b ) return ( tonumber ( a.data ) or 0 ) > ( tonumber ( b.data ) or 0 ) end ) outputChatBox ( "#c0c0c0* Top 5 #abcdefwins #c0c0c0on this map:", root, 255, 255, 255, true ) for i = 1, 5 do outputChatBox ( "#c0c0c0* #abcdef".. i .."#c0c0c0. #abcdef".. tostring ( tableOrder [ i ].name ) .." #c0c0c0- #abcdef".. tostring ( tableOrder [ i ].data ).. "#c0c0c0x", root, 255, 255, 255, true ) end end addEventHandler ( 'onMapStarting', root, topmap) hi i have this code. but i want to send top 5 to client side. ex: how can i do it?
  12. server: local sounds = { "http://www.mysound1.com/sound1", "http://www.mysound1.com/sound2" } function zaa() triggerClientEvent ( "onPlayerJoinMusic", getRootElement(), sounds [ math.random ( 1, #sounds ) ] ) end addEventHandler ( "onPlayerJoin", resourceRoot, zaa) client: function music ( file ) playSound ( file ) end addEvent( "onPlayerJoinMusic", true ) addEventHandler( "onPlayerJoinMusic", root, music ) ---------------------------or------------------------- client: local sounds = { "http://www.mysound1.com/sound1", "http://www.mysound1.com/sound2" } function zaa() playSound ( sounds [ math.random ( 1, #sounds ) ] ) end addEventHandler ( "onClientPlayerJoin", getRootElement(), zaa)
  13. hi, i sent an email to you. i wait for answer. i wanna buy 24 slots server from you guys. so will give me a price?
  14. its dont output chat anything. also dont show the killer on screen
  15. when i hit some car its output: i wanna define the "killer" not the "killed"
  16. well i havent problem on account things for now. i cant define the "killer"
  17. client: local vehModel = nil local screen_x, screen_y = guiGetScreenSize() local font = "bankgothic" local scale = screen_x / 1000 local message = "" local messWidth = 1 local messHeight = 1 addEventHandler("onClientVehicleCollision", root, function(collider) if collider then if getElementType(collider)=="vehicle" and getElementHealth(source)>250 and isElementInWater(source)==false then triggerServerEvent("vehicleCollision", source, collider) end end end ) addEvent("showDeathMess", true) addEventHandler("showDeathMess", getRootElement(), function(theKiller) if(source ~= getLocalPlayer())then return end addEventHandler("onClientRender", getRootElement(), kill) message = "Killed by: "..theKiller messWidth = dxGetTextWidth(message, scale, font) messHeight = dxGetFontHeight(scale, font) setTimer(function() removeEventHandler("onClientRender", getRootElement(), kill) end, 5000, 1) end) function kill() dxDrawText(message, screen_x/2 - messWidth/2, screen_y/2 - messHeight/2, screen_x, screen_y, tocolor(255, 0, 0, 150), scale, font) end server: function collider ( collider ) outputChatBox ( "Killer: " .. collider, source ) local acc = getPlayerAccount( collider ) local kills = getAccountData( acc,"kills" ) or 0 setAccountData( acc,"kills", kills+1) triggerClientEvent("showDeathMess", source, collider) end addEvent( "vehicleCollision", true ) addEventHandler( "vehicleCollision", getRootElement(), collider ) function wasted() local acc = getPlayerAccount( source ) local deaths = getAccountData( acc,"deaths" ) or 0 setAccountData( acc,"deaths", deaths+1) end addEventHandler( "onPlayerWasted", getRootElement(), wasted ) what i am doing wrong?
  18. Fury

    object are shining

    hmm. i dont know anything about 3ds max and my friend is in holiday. so i need your help. can you do it for me? http://tr.rghost.net/39988987 thank you very much from now
  19. hi guys, my friend has designed a object in 3ds max. it working perfect but have a problem. when car lights is opened, it starts the shining. script: txd = engineLoadTXD ( "road1.txd" ) engineImportTXD ( txd, 3458 ) dff = engineLoadDFF ( "road1.dff", 3458 ) engineReplaceModel ( dff, 3458 ) col = engineLoadCOL ( "road1.col" ) engineReplaceCOL ( col, 3458 ) image: http://f1208.hizliresim.com/10/r/c5km2.png please help us, thank you! ps: closing the headlight can solve the problem? or am i doing wrong scripting?
  20. oh you got me so wrong. im talking about make a table like chatbox. when im writing ex: outPutTable( "zaa", source, 255,255,255,true) outPutTable( "zaa2", source, 255,255,255,true) outPutTable( "zaa3", source, 255,255,255,true) outPutTable will be like this: zaa zaa2 zaa3 and it will be non-visible for a while later. is that possible?
  21. how can i? Easiest would be doing a GUI then adding the text. Nothing I can recommend for a beginner though. well i now how to use dx functions but i cant make a table like chatbox. thats the problem. and im not a beginner
  22. is this possible to edit ChatBox? I mean can i change the position of chat?
  23. Fury

    about color picker

    thanks. server: -------------------------------- -- Car color selecter & saver -- -------------------------------- function zaa ( id, type, model ) local account = getPlayerAccount( source ) local cani = getAccountData( account,"canichangecarcolor" ) or 0 if cani == 0 then if ( getPlayerTeam ( source ) ) then if ( eventName == "onPlayerPickUpRacePickup" and id == "vehiclechange" or id == "repair" or id == "nitro" ) then local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) else local r, g, b = getTeamColor ( getPlayerTeam ( source ) ) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end elseif cani == 1 then if ( eventName == "onPlayerPickUpRacePickup" and id == "vehiclechange" or id == "repair" or id == "nitro" ) then local r = tonumber(getAccountData( account,"r" )) local g = tonumber(getAccountData( account,"g" )) local b = tonumber(getAccountData( account,"b" )) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) else local r = tonumber(getAccountData( account,"r" )) local g = tonumber(getAccountData( account,"g" )) local b = tonumber(getAccountData( account,"b" )) local vehicle = getPedOccupiedVehicle(source) setVehicleColor ( vehicle, r, g, b ) end end end addEvent ("onPlayerPickUpRacePickup", true) addEventHandler ("onPlayerPickUpRacePickup", root, zaa) addEventHandler ("onPlayerVehicleEnter", root, zaa) function carcolor ( element, r, g, b ) local account = getPlayerAccount( element ) setAccountData( account,"r", tonumber(r) ) setAccountData( account,"g", tonumber(g) ) setAccountData( account,"b", tonumber(b) ) setAccountData( account,"canichangecarcolor", 1 ) setVehicleColor(element, r, g, b) end addEvent( "onChangeCarColor", true ) addEventHandler( "onChangeCarColor", root, carcolor ) bad argument in 42, 43, 44 line client: selectcarcolor = guiCreateButton(283,48,152,43,"Select Car Colour",false,Vendetta_Tab[6]) selectheadlightcolor = guiCreateButton(283,105,152,43,"Select Headlights Colour",false,Vendetta_Tab[6]) function openn () openPicker ( "Car color", "#FFFFFF", "Car color changer" ) end function openn1 () openPicker ( "Headlight color", "#FFFFFF", "Car color changer" ) end function colorsevent() addEventHandler ( "onClientGUIClick", selectcarcolor, openn, false ) addEventHandler ( "onClientGUIClick", selectheadlightcolor, openn1, false ) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), colorsevent) color picker: sw, sh = guiGetScreenSize() pickerTable = {} colorPicker = {} colorPicker.__index = colorPicker function openPicker(id, start, title) if id and not pickerTable[id] then pickerTable[id] = colorPicker.create(id, start, title) pickerTable[id]:updateColor() return true end return false end function closePicker(id) if id and pickerTable[id] then pickerTable[id]:destroy() return true end return false end function colorPicker.create(id, start, title) local cp = {} setmetatable(cp, colorPicker) cp.id = id cp.color = {} cp.color.h, cp.color.s, cp.color.v, cp.color.r, cp.color.g, cp.color.b, cp.color.hex = 0, 1, 1, 255, 0, 0, "#FF0000" cp.color.white = tocolor(255,255,255,255) cp.color.black = tocolor(0,0,0,255) cp.color.current = tocolor(255,0,0,255) cp.color.huecurrent = tocolor(255,0,0,255) if start and getColorFromString(start) then cp.color.h, cp.color.s, cp.color.v = rgb2hsv(getColorFromString(start)) end cp.gui = {} cp.gui.width = 416 cp.gui.height = 304 cp.gui.snaptreshold = 0.02 cp.gui.window = guiCreateWindow((sw-cp.gui.width)/2, (sh-cp.gui.height)/2, cp.gui.width, cp.gui.height, tostring(title or "COLORPICKER"), false) cp.gui.svmap = guiCreateStaticImage(16, 32, 256, 256, "images/picker/blank.png", false, cp.gui.window) cp.gui.hbar = guiCreateStaticImage(288, 32, 32, 256, "images/picker/blank.png", false, cp.gui.window) cp.gui.blank = guiCreateStaticImage(336, 32, 64, 64, "images/picker/blank.png", false, cp.gui.window) cp.gui.edith = guiCreateLabel(338, 106, 64, 20, "H: 0°", false, cp.gui.window) cp.gui.edits = guiCreateLabel(338, 126, 64, 20, "S: 100%", false, cp.gui.window) cp.gui.editv = guiCreateLabel(338, 146, 64, 20, "V: 100%", false, cp.gui.window) cp.gui.editr = guiCreateLabel(338, 171, 64, 20, "R: 255", false, cp.gui.window) cp.gui.editg = guiCreateLabel(338, 191, 64, 20, "G: 0", false, cp.gui.window) cp.gui.editb = guiCreateLabel(338, 211, 64, 20, "B: 0", false, cp.gui.window) cp.gui.okb = guiCreateButton(336, 235, 64, 24, "OK", false, cp.gui.window) cp.gui.closeb = guiCreateButton(336, 265, 64, 24, "Cancel", false, cp.gui.window) guiWindowSetSizable(cp.gui.window, false) cp.handlers = {} cp.handlers.mouseDown = function() cp:mouseDown() end cp.handlers.mouseSnap = function() cp:mouseSnap() end cp.handlers.mouseUp = function(b,s) cp:mouseUp(b,s) end cp.handlers.mouseMove = function(x,y) cp:mouseMove(x,y) end cp.handlers.render = function() cp:render() end cp.handlers.guiFocus = function() cp:guiFocus() end cp.handlers.guiBlur = function() cp:guiBlur() end cp.handlers.pickColor = function() cp:pickColor() end cp.handlers.destroy = function() cp:destroy() end addEventHandler("onClientGUIMouseDown", cp.gui.svmap, cp.handlers.mouseDown, false) addEventHandler("onClientMouseLeave", cp.gui.svmap, cp.handlers.mouseSnap, false) addEventHandler("onClientMouseMove", cp.gui.svmap, cp.handlers.mouseMove, false) addEventHandler("onClientGUIMouseDown", cp.gui.hbar, cp.handlers.mouseDown, false) addEventHandler("onClientMouseMove", cp.gui.hbar, cp.handlers.mouseMove, false) addEventHandler("onClientClick", root, cp.handlers.mouseUp) addEventHandler("onClientGUIMouseUp", root, cp.handlers.mouseUp) addEventHandler("onClientRender", root, cp.handlers.render) addEventHandler("onClientGUIFocus", cp.gui.window, cp.handlers.guiFocus, false) addEventHandler("onClientGUIBlur", cp.gui.window, cp.handlers.guiBlur, false) addEventHandler("onClientGUIClick", cp.gui.okb, cp.handlers.pickColor, false) addEventHandler("onClientGUIClick", cp.gui.closeb, cp.handlers.destroy, false) showCursor(true) return cp end function colorPicker:render() -- if not self.gui.focus then return end local x,y = guiGetPosition(self.gui.window, false) dxDrawRectangle(x+16, y+32, 256, 256, self.color.huecurrent, self.gui.focus) dxDrawImage(x+16, y+32, 256, 256, "images/picker/sv.png", 0, 0, 0, self.color.white, self.gui.focus) dxDrawImage(x+288, y+32, 32, 256, "images/picker/h.png", 0, 0, 0, self.color.white, self.gui.focus) dxDrawImageSection(x+8+math.floor(256*self.color.s), y+24+(256-math.floor(256*self.color.v)), 16, 16, 0, 0, 16, 16, "images/picker/cursor.png", 0, 0, 0, self.color.white, self.gui.focus) dxDrawImageSection(x+280, y+24+(256-math.floor(256*self.color.h)), 48, 16, 16, 0, 48, 16, "images/picker/cursor.png", 0, 0, 0, self.color.huecurrent, self.gui.focus) dxDrawRectangle(x+336, y+32, 64, 64, self.color.current, self.gui.focus) dxDrawText(self.color.hex, x+336, y+32, x+400, y+96, self.color.v < 0.5 and self.color.white or self.color.black, 1, "default", "center", "center", true, true, self.gui.focus) end function colorPicker:mouseDown() if source == self.gui.svmap or source == self.gui.hbar then self.gui.track = source local cx, cy = getCursorPosition() self:mouseMove(sw*cx, sh*cy) end end function colorPicker:mouseUp(button, state) if not state or state ~= "down" then if self.gui.track then triggerEvent("onColorPickerChange", root, self.id, self.color.hex, self.color.r, self.color.g, self.color.b) end self.gui.track = false end end function colorPicker:mouseMove(x,y) if self.gui.track and source == self.gui.track then local gx,gy = guiGetPosition(self.gui.window, false) if source == self.gui.svmap then local offsetx, offsety = x - (gx + 16), y - (gy + 32) self.color.s = offsetx/255 self.color.v = (255-offsety)/255 elseif source == self.gui.hbar then local offset = y - (gy + 32) self.color.h = (255-offset)/255 end self:updateColor() end end function colorPicker:mouseSnap() if self.gui.track and source == self.gui.track then if self.color.s < self.gui.snaptreshold or self.color.s > 1-self.gui.snaptreshold then self.color.s = math.round(self.color.s) end if self.color.v < self.gui.snaptreshold or self.color.v > 1-self.gui.snaptreshold then self.color.v = math.round(self.color.v) end self:updateColor() end end function colorPicker:updateColor() self.color.r, self.color.g, self.color.b = hsv2rgb(self.color.h, self.color.s, self.color.v) self.color.current = tocolor(self.color.r, self.color.g, self.color.b,255) self.color.huecurrent = tocolor(hsv2rgb(self.color.h, 1, 1)) self.color.hex = string.format("#%02X%02X%02X", self.color.r, self.color.g, self.color.b) guiSetText(self.gui.edith, "H: "..tostring(math.round(self.color.h*360)).."°") guiSetText(self.gui.edits, "S: "..tostring(math.round(self.color.s*100)).."%") guiSetText(self.gui.editv, "V: "..tostring(math.round(self.color.v*100)).."%") guiSetText(self.gui.editr, "R: "..tostring(self.color.r)) guiSetText(self.gui.editg, "G: "..tostring(self.color.g)) guiSetText(self.gui.editb, "B: "..tostring(self.color.b)) end function colorPicker:guiFocus() self.gui.focus = true guiSetAlpha(self.gui.window, 1) end function colorPicker:guiBlur() self.gui.focus = false guiSetAlpha(self.gui.window, 0.5) end function colorPicker:pickColor() triggerEvent("onColorPickerOK", root, self.id, self.color.hex, self.color.r, self.color.g, self.color.b) self:destroy() end function colorPicker:destroy() removeEventHandler("onClientGUIMouseDown", self.gui.svmap, self.handlers.mouseDown) removeEventHandler("onClientMouseLeave", self.gui.svmap, self.handlers.mouseSnap) removeEventHandler("onClientMouseMove", self.gui.svmap, self.handlers.mouseMove) removeEventHandler("onClientGUIMouseDown", self.gui.hbar, self.handlers.mouseDown) removeEventHandler("onClientMouseMove", self.gui.hbar, self.handlers.mouseMove) removeEventHandler("onClientClick", root, self.handlers.mouseUp) removeEventHandler("onClientGUIMouseUp", root, self.handlers.mouseUp) removeEventHandler("onClientRender", root, self.handlers.render) removeEventHandler("onClientGUIFocus", self.gui.window, self.handlers.guiFocus) removeEventHandler("onClientGUIBlur", self.gui.window, self.handlers.guiBlur) removeEventHandler("onClientGUIClick", self.gui.okb, self.handlers.pickColor) removeEventHandler("onClientGUIClick", self.gui.closeb, self.handlers.destroy) destroyElement(self.gui.window) pickerTable[self.id] = nil setmetatable(self, nil) showCursor(areThereAnyPickers()) end function areThereAnyPickers() for _ in pairs(pickerTable) do return true end return false end function hsv2rgb(h, s, v) local r, g, b local i = math.floor(h * 6) local f = h * 6 - i local p = v * (1 - s) local q = v * (1 - f * s) local t = v * (1 - (1 - f) * s) local switch = i % 6 if switch == 0 then r = v g = t b = p elseif switch == 1 then r = q g = v b = p elseif switch == 2 then r = p g = v b = t elseif switch == 3 then r = p g = q b = v elseif switch == 4 then r = t g = p b = v elseif switch == 5 then r = v g = p b = q end return math.floor(r*255), math.floor(g*255), math.floor(b*255) end function rgb2hsv(r, g, b) r, g, b = r/255, g/255, b/255 local max, min = math.max(r, g, b), math.min(r, g, b) local h, s local v = max local d = max - min s = max == 0 and 0 or d/max if max == min then h = 0 elseif max == r then h = (g - b) / d + (g < b and 6 or 0) elseif max == g then h = (b - r) / d + 2 elseif max == b then h = (r - g) / d + 4 end h = h/6 return h, s, v end function math.round(v) return math.floor(v+0.5) end addEvent("onColorPickerOK", true) addEvent("onColorPickerChange", true) its working but when i press OK and change color nothing happends.
×
×
  • Create New...