-
Posts
350 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Snow-Man
-
hello everyone im working on shader script for cj clothes but have faced some problem how can i make shader texture on specific cj clothes for example i have used this texture for hat cj_ped_hat but it works on all hats not only specific ones that i wanted to apply on i have tried to use clothes name as redcap but that doesnt work and made a shader for all elements needed such as marker too but doesnt work any help or guide can give me texture name to use them properly
-
Hello idk why these doesnt work about numbers of table this one #(vehicleBlip[vehicle]) >= 2 vehicleBlip = {} function createBlipAttachedToVehicle(player, vehicle) if isElement( player ) and isElement(vehicle) and getElementType( player ) == "player" and getElementType( vehicle ) == "vehicle" then if isElement(vehicleBlip[vehicle]) then destroyElement( vehicleBlip[vehicle] ) vehicleBlip[vehicle] = nil end vehicleBlip[vehicle] = createBlipAttachedTo(vehicle, 48, 2, 255, 255, 255, 255, 0, 99999, player ) if #(vehicleBlip[vehicle]) >= 2 then destroyElement( vehicleBlip[vehicle] ) end outputDebugString( vehicleBlip[vehicle], 3) end end sometimes it says event isnt added addEvent("onClientClickOnVehicle", true) function vehicleOption(action, element ) if action == "repair" then end end addEventHandler("onClientClickOnVehicle", root, vehicleOption)
-
hello thank you for the reply the problem isnt on that function, mine works great and tested it on other dx effects but didnt know solution to click on element then to click on option showed on dx so it get element each time i click even showing one from options
-
Hello guys. i have been working on new script but i have had a problem that event doesnt continue i mean some parts doesnt work and it double click first of all it gets the right element is the vehicle then gets another click when dx opened function clickVehicle(button, state, absX, absY, wx, wy, wz, clickedElement) if isActivated == false then return false end --if action ~= nil then return false end action = "" if (clickedElement) and (getElementType(clickedElement)== 'vehicle') and (button=='right') and (state=='down') then outputDebugString(getElementType(clickedElement)) element = clickedElement isOpened = true outputDebugString('1') if isCursorOverText((407/x)*w, (448/y)*h, (507/x)*w, (496/y)*h) then action = "repair" outputDebugString(action) elseif isCursorOverText((529/x)*w, (448/y)*h, (629/x)*w, (496/y)*h) then action = 'getinto' outputDebugString(action) elseif isCursorOverText((647/x)*w, (448/y)*h, (747/x)*w, (496/y)*h) then action = 'recover' outputDebugString(action) elseif isCursorOverText((761/x)*w, (448/y)*h, (861/x)*w, (496/y)*h) then action = 'mark' outputDebugString(action) triggerServerEvent("onClientClickOnVehicle", getLocalPlayer(), action, element) outputDebugString ( element ) end end end
-
Any suggestions about design of login and the rest things as you said
-
Just interiors and exteriors positions on Database
-
I mean suggestions to work on them
-
i have made house system with full house entrace positions tooks me 2 weeks and file size 30MB, is there any solution to make house interior easier more than mine?
-
i have got problem to use ajax, i'm trying to link my server to my forum any help? full details
-
i'm working on my new server and i need good suggestions to make them for my rpg server please any suggestions to help?
-
i have posted full script again. offs = 45 opened = false event = addEventHandler remove = removeEventHandler smX, smY = 1280, 1024 sX, sY = guiGetScreenSize( ) selected = 1 move = 0 moved_up = 0 local ammunationWeapons = { {16,3000, 5}, {22,500, 30}, {23,600, 30}, {24,1200, 15}, {25,600, 15}, {26,800, 12}, {27,1000, 10}, {28,500, 60}, {29,2000, 90}, {30,3500, 120}, {31,4500, 150}, {32,300, 60}, {33,600, 20}, {34,5000, 10}, {46,800, 1}, } setposition = 250 function dxDrawAmmuShop() if opened == true then return false end DxDrawBorderedRectangle(64, 186, 313, 411, tocolor(0, 0, 0, 150), false) dxDrawBorderedText("USC ~ Weapons Shop", 66, 185, 377, 212, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "center", "center", false, false, false, false, false) dxDrawBorderedText("Weapons", 66, 212, 269, 236, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) for i, v in ipairs ( ammunationWeapons )do name = i r2, g2, b2, size2 = ItemsHower() dxDrawBorderedText("Price", 269, 212, 377, 236, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText(getWeaponNameFromID(v[1]), 66, (210+(i*offs)), 269, 270, tocolor(r2, g2, b2, 255),size2, "bankgothic", "left", "center", false, false, false, false, false) dxDrawText(tocomma(v[2]).."$", 269, 210+(i*offs), 377, 270, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) end dxDrawFixedLine(64, 240, 377, 240, tocolor(255, 255, 255, 255), 3, false) dxDrawFixedLine(269, 212, 269, 597, tocolor(255, 255, 255, 255), 3, false) dxDrawFixedLine(64, 212, 377, 212, tocolor(255, 255, 255, 255), 3, false) r, g, b, size = buttonHover() r1, g1, b1, size1= closeHover() DxDrawBorderedRectangle(64, 603, 313, 32, tocolor(0, 0, 0, 200), false) dxDrawBorderedText("Purchase", 64, 602, 221, 635, tocolor(r, g, b, 255), size, "bankgothic", "center", "center", false, false, false, false, false) dxDrawBorderedText("Close", 221, 602, 378, 635, tocolor(r1, g1, b1, 255), size1, "bankgothic", "center", "center", false, false, false, false, false) if #ammunationWeapons ~= i then dxDrawFixedRectangle(64, setposition, 312, 23, tocolor(0, 0, 0, 100), false) end end function buttonHover() if isMouseInPosition(64, 602, 221, 635) then r,g, b, size= 200, 200, 0, 0.9 else r,g, b, size = 255, 255, 255, 0.8 end return r,g, b, size end function closeHover() if isMouseInPosition(221, 602, 378, 635) then r1, g1, b1, size1= 200, 200, 0, 0.9 else r1, g1, b1, size1= 255, 255, 255, 0.8 end return r1, g1, b1, size1 end function ItemsHower() if isMouseInPosition(66, (210+(name*offs)), 269, 270) then r2, g2, b2, size2= 200, 200, 0, 0.7 else r2, g2, b2, size2= 255, 255, 255, 0.6 end return r2, g2, b2, size2 end addEvent("setAmmuGUIVisible", true) function setAmmuGUIVisible() if opened == false then toggleAllControls( false) event("onClientRender", root,dxDrawAmmuShop) showCursor(true) event("onClientKey", root, onPlayerDxHit) event("onClientKey", root, onPlayerChooseWep) end end event("setAmmuGUIVisible", root, setAmmuGUIVisible) function onPlayerDxHit(key, pressed) if not key == "mouse1" then return false end if isMouseInPosition(sX*(221/smX), sY*(602/smY), sX*(378/smX), sY*(635/smY)) then close() end end function close() opened = false showCursor(false) --toggleAllControls( true) setTimer(toggleAllControls, 50, 1, true) remove("onClientRender", root, dxDrawAmmuShop) remove("onClientKey", root, onPlayerDxHit) remove("onClientKey", root, onPlayerChooseWep) end function isMouseInPosition(x1,y1,x2,y2, type) if not isCursorShowing() then return false end local cx,cy = getCursorPosition() cx,cy = cx*sX,cy*sY if cx >= sX*(x1/smX) and cx <= (type == true and sX*(x2/smX) + sX*(x1/smX) or sX*(x2/smX)) and cy >= sY*(y1/smY) and cy <= (type == true and sY*(y2/smY) + sY*(y1/smY) or sY*(y2/smY)) then return true,cx,cy else return false end end function onPlayerChooseWep(key, press) if not key or not key=="mouse1" and not press then return false end if not (name) then return false end cx, cy = getCursorPosition( ) cy = (cy*sY)-21 cx = cx*sX if cy >= sY*(560/smY) or cy <= sY*(235/smY) then return false end if cx <= sX*(66/smX) or cx >= sX*(377/smX) then return false end setposition = cy+(name) end addEventHandler( "onClientPlayerWasted", localPlayer, function() close() end )
-
i have tried your code and i got result -> table:2482C1F8 my code is works good but i only get one data
-
i don't mean that, i tried to do speed meter with x movements to bar, that's code it's working fine but i think it's got alot of problems,
-
offs = 45 opened = false event = addEventHandler remove = removeEventHandler smX, smY = 1280, 1024 sX, sY = guiGetScreenSize( ) selected = 1 move = 0 moved_up = 0 local ammunationWeapons = { {16,3000, 5}, {22,500, 30}, {23,600, 30}, {24,1200, 15}, {25,600, 15}, {26,800, 12}, {27,1000, 10}, {28,500, 60}, {29,2000, 90}, {30,3500, 120}, {31,4500, 150}, {32,300, 60}, {33,600, 20}, {34,5000, 10}, {46,800, 1}, } setposition = 250 function dxDrawAmmuShop() if opened == true then return false end DxDrawBorderedRectangle(64, 186, 313, 411, tocolor(0, 0, 0, 150), false) dxDrawBorderedText("USC ~ Weapons Shop", 66, 185, 377, 212, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "center", "center", false, false, false, false, false) dxDrawBorderedText("Weapons", 66, 212, 269, 236, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) for i, v in ipairs ( ammunationWeapons )do name = i r2, g2, b2, size2 = ItemsHower() dxDrawBorderedText("Price", 269, 212, 377, 236, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText(getWeaponNameFromID(v[1]), 66, (210+(i*offs)), 269, 270, tocolor(r2, g2, b2, 255),size2, "bankgothic", "left", "center", false, false, false, false, false) dxDrawText(tocomma(v[2]).."$", 269, 210+(i*offs), 377, 270, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) end dxDrawFixedLine(64, 240, 377, 240, tocolor(255, 255, 255, 255), 3, false) dxDrawFixedLine(269, 212, 269, 597, tocolor(255, 255, 255, 255), 3, false) dxDrawFixedLine(64, 212, 377, 212, tocolor(255, 255, 255, 255), 3, false) r, g, b, size = buttonHover() r1, g1, b1, size1= closeHover() DxDrawBorderedRectangle(64, 603, 313, 32, tocolor(0, 0, 0, 200), false) dxDrawBorderedText("Purchase", 64, 602, 221, 635, tocolor(r, g, b, 255), size, "bankgothic", "center", "center", false, false, false, false, false) dxDrawBorderedText("Close", 221, 602, 378, 635, tocolor(r1, g1, b1, 255), size1, "bankgothic", "center", "center", false, false, false, false, false) if #ammunationWeapons ~= i then dxDrawFixedRectangle(64, setposition, 312, 23, tocolor(0, 0, 0, 100), false) end end function buttonHover() if isMouseInPosition(64, 602, 221, 635) then r,g, b, size= 200, 200, 0, 0.9 else r,g, b, size = 255, 255, 255, 0.8 end return r,g, b, size end function closeHover() if isMouseInPosition(221, 602, 378, 635) then r1, g1, b1, size1= 200, 200, 0, 0.9 else r1, g1, b1, size1= 255, 255, 255, 0.8 end return r1, g1, b1, size1 end function ItemsHower() if isMouseInPosition(66, (210+(name*offs)), 269, 270) then r2, g2, b2, size2= 200, 200, 0, 0.7 else r2, g2, b2, size2= 255, 255, 255, 0.6 end return r2, g2, b2, size2 end addEvent("setAmmuGUIVisible", true) function setAmmuGUIVisible() if opened == false then toggleAllControls( false) event("onClientRender", root,dxDrawAmmuShop) showCursor(true) event("onClientKey", root, onPlayerDxHit) event("onClientKey", root, onPlayerChooseWep) end end event("setAmmuGUIVisible", root, setAmmuGUIVisible) function onPlayerDxHit(key, pressed) if not key == "mouse1" then return false end if isMouseInPosition(sX*(221/smX), sY*(602/smY), sX*(378/smX), sY*(635/smY)) then close() end end function close() opened = false showCursor(false) --toggleAllControls( true) setTimer(toggleAllControls, 50, 1, true) remove("onClientRender", root, dxDrawAmmuShop) remove("onClientKey", root, onPlayerDxHit) remove("onClientKey", root, onPlayerChooseWep) end function isMouseInPosition(x1,y1,x2,y2, type) if not isCursorShowing() then return false end local cx,cy = getCursorPosition() cx,cy = cx*sX,cy*sY if cx >= sX*(x1/smX) and cx <= (type == true and sX*(x2/smX) + sX*(x1/smX) or sX*(x2/smX)) and cy >= sY*(y1/smY) and cy <= (type == true and sY*(y2/smY) + sY*(y1/smY) or sY*(y2/smY)) then return true,cx,cy else return false end end function onPlayerChooseWep(key, press) if not key or not key=="mouse1" and not press then return false end if not (name) then return false end cx, cy = getCursorPosition( ) cy = (cy*sY)-21 cx = cx*sX if cy >= sY*(560/smY) or cy <= sY*(235/smY) then return false end if cx <= sX*(66/smX) or cx >= sX*(377/smX) then return false end setposition = cy+(name) end addEventHandler( "onClientPlayerWasted", localPlayer, function() close() end )
-
how to get all data from sql, in my script it's show me only recent data function getTransactionBankLog(player) if (player) then local transaction = exports.USCsql:query( "SELECT * FROM bank_transaction WHERE accName = ?", getAccountName(getPlayerAccount(player))) if transaction and transaction['log'] and transaction['date'] then local tran, date = transaction['log'] ,transaction['date'] return tran, date else return false end end end
-
i have started with new script, i have got some problems on it, it's about weapon shops with dx functions how can i make weapon selected, i have made table of weapons using one dxDrawText here's my code offs = 45 valid_key = {["mouse1"] = true} opened = false event = addEventHandler remove = removeEventHandler smX, smY = 1280, 1024 sX, sY = guiGetScreenSize( ) local ammunationWeapons = { {16,3000, 5}, {22,500, 30}, {23,600, 30}, {24,1200, 15}, {25,600, 15}, {26,800, 12}, {27,1000, 10}, {28,500, 60}, {29,2000, 90}, {30,3500, 120}, {31,4500, 150}, {32,300, 60}, {33,600, 20}, {34,5000, 10}, {46,800, 1}, } setposition = 250 function dxDrawAmmuShop() if opened == true then return false end DxDrawBorderedRectangle(64, 186, 313, 411, tocolor(0, 0, 0, 150), false) dxDrawBorderedText("USC ~ Weapons Shop", 66, 185, 377, 212, tocolor(255, 255, 255, 255), 0.80, "bankgothic", "center", "center", false, false, false, false, false) dxDrawBorderedText("Weapons", 66, 212, 269, 236, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) for i, v in ipairs ( ammunationWeapons )do name = i r2, g2, b2, size2 = ItemsHower() dxDrawBorderedText("Price", 269, 212, 377, 236, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) dxDrawText(getWeaponNameFromID(v[1]), 66, (210+(i*offs)), 269, 270, tocolor(r2, g2, b2, 255),size2, "bankgothic", "left", "center", false, false, false, false, false) dxDrawText(tocomma(v[2]).."$", 269, 210+(i*offs), 377, 270, tocolor(255, 255, 255, 255), 0.70, "bankgothic", "center", "center", false, false, false, false, false) end dxDrawFixedLine(64, 240, 377, 240, tocolor(255, 255, 255, 255), 3, false) dxDrawFixedLine(269, 212, 269, 597, tocolor(255, 255, 255, 255), 3, false) dxDrawFixedLine(64, 212, 377, 212, tocolor(255, 255, 255, 255), 3, false) r, g, b, size = buttonHover() r1, g1, b1, size1= closeHover() DxDrawBorderedRectangle(64, 603, 313, 32, tocolor(0, 0, 0, 200), false) dxDrawBorderedText("Purchase", 64, 602, 221, 635, tocolor(r, g, b, 255), size, "bankgothic", "center", "center", false, false, false, false, false) dxDrawBorderedText("Close", 221, 602, 378, 635, tocolor(r1, g1, b1, 255), size1, "bankgothic", "center", "center", false, false, false, false, false) if #ammunationWeapons ~= i then dxDrawFixedRectangle(64, setposition, 312, 23, tocolor(0, 0, 0, 100), false) end end i have posted half of it but it's working fine just need to know how to get item selected and select it
-
i have made vehicle hud but i'm asking if it's fully correct, it's works fine in my resolution and differents ones but need to fix it local max = (math.floor(getVehicleHandling(vehicle)["maxVelocity"])*3.6) exports.USCmisc:DxDrawBorderedRectangle(sX*(1061/msX)+(sX)*(mph/(max*1.49)), sY*(824/msY), sX*(3/msX), sY*(25/msY), tocolor(145, 0, 0, 255), 2)
-
i know that, i forget to change it, i have changed that when i tried to make this topic idk why it's works sometimes, anyways it's works now and i didn't change anything on my code
-
everytime, when i use triggerClientEvent, it's doesn't work but sometimes do it's said client event isn't added here my script server : function onMarkerBankHit(player, matchingDimension) if getElementData(source, "USC.Bank") and not isGuestAccount(hitPlayer) then if (getElementType(player) ~= "player" or not matchingDimension) then return end if (isPedInVehicle(player) or not isPedOnGround(player)) then return end local account = getAccountName(getPlayerAccount(player)) triggerClientEvent(player,"USCbank:showBankGUI",player,account) end end addEventHandler("onMarkerHit", root, onMarkerBankHit) client : addEvent("USCbank:showBankGUI", true) addEventHandler("USCbank:showBankGUI", root, function (account) guiSetVisible(USC.window[1], true) showCursor(true) guiSetText(USC.label[1], "Account Name : "..account) end)
-
everytime, when i use triggerClientEvent, it's doesn't work but sometimes do it's said client event isn't added here my script server : function onMarkerBankHit(player, matchingDimension) if getElementData(source, "USC.Bank") and not isGuestAccount(hitPlayer) then if (getElementType(player) ~= "player" or not matchingDimension) then return end if (isPedInVehicle(player) or not isPedOnGround(player)) then return end local account = getAccountName(getPlayerAccount(player)) triggerClientEvent(player,"USCbank:showBankGUI",player,account) end end addEventHandler("onMarkerHit", root, onMarkerBankHit) client : addEvent("USCbank:showBankGUI", true) addEventHandler("USCbank:showBankGUI", root, function (account) guiSetVisible(USC.window[1], true) showCursor(true) guiSetText(USC.label[1], "Account Name : "..account) end)
-
i think correct syntax of SQL creating table is like this local connection = dbConnect("sqlite", "test.db") dbExec(connection,"CREATE TABLE IF NOT EXISTS table(numberone TEXT, numbertwo TEXT)")