-
Posts
512 -
Joined
-
Last visited
Everything posted by 3B00DG4MER
-
first you've to define the sound as variable local mySound = playSound("You Path Here", bool loop) for loop do true or false (True means repeat when finnsh, false don't repeat) if you want to stop the sound use stopSound function stopSound(mySound)
-
as i think he didn't request he don't know how to run the script
-
playSound("Your Path here", false) in loop do false means don't reply on finnish.
-
"onPlayerWasted" givePlayerMoney
-
Next time read carefully the resource instructions !(if there is ) :
-
Ty it's work !
-
Ty in the first time i tried to add interactive for cursor but i didn't know the full code BUT ANYWAY THANK YOU , NOW I CAN MAKE IT !!!!!!! After Reading Code , it's look like easy just add something only
-
read the Code UP ^^^ you need a table and to do that read the code UP ^^ some of the code : dxDrawRectangle(b.x ,b.y ,b.w,b.h,b.color) dxDrawRectangle(b.x , b.y , b.w, 1, b.borderColor) dxDrawRectangle(b.x , b.y , 1, b.h, b.borderColor) dxDrawRectangle(b.x, b.y + b.h , b.w, 1, b.borderColor) dxDrawRectangle(b.x + b.w, b.y , 1, b.h, b.borderColor) Now can u help me with it how i can get pos of mouse in the holoscreen ?!
-
can u give me example on Demo file it won't work for me !! it's get pos of Target of weapon only !
-
it's get pos of Target of Weapon and not mouse ! Plz help
-
اصحى على الساعة 12 - 10 اروح اشرب كوب شاي روح الكميوتر ابرمج على السيرفر بتاعي واذا علقت اروح Scripting احط الكود و اقد استنى واذا لحقت 12 بليل اروح انام تذكير عندي كثيرر ما شفت الشمس ساطعة مراااااات اذا فتحت النافذة
-
Can u tell me how did you make the mouse when it's on the holoscreen PLZ ?!!!!!! PLEASE
-
Can anyone help Me with this ?! viewtopic.php?f=91&t=83562
-
it's only debug ss when mouse is in a place on screen and not into holoscreen i want it like dis one viewtopic.php?f=108&t=83482
-
if isMouseWithinRangeOf(b.x , b.y , b.w, b.h) then dxDrawRectangle(b.x ,b.y ,b.w,b.h,tocolor(0,255,255)) if b.text then dxDrawText ( b.text, b.x , b.y , b.x + b.w , b.y + b.h , tocolor(255,255,255), sW/1600, myFont, "center", "center") end end function isMouseWithinRangeOf(posX, posY, sizeX, sizeY) local sW, sH = dxGetMaterialSize(RTE_Demo) if isCursorShowing() == false then return false end local cx,cy = getCursorPosition() cx,cy = cx*sW,cy*sH if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then return true,cx,cy else return false end end But listen !! i don't want that on Screen i want it on the holoscreen !
-
Come on guys ! I need a help ! i'm alone here
-
Help ?!
-
i did but no one answer
-
The samt2497's resource takes care of that. What the function i use ? i mean when the mouse is range of the button won't change color as i make it first of all how i can get mouse position in the holoscreen !! here is code : RTE_Demo = nil RTE_Holo = nil addEventHandler( "onClientResourceStart", resourceRoot, function ( startedRes ) local holoscreen,RT_ID,RTE = createHoloScreen(149,2482,16.5,40,0,90,5.35,6) --Create our holoscreen setElementData(holoscreen,"interactive","aim") -- Make it interactive on user aim if RTE then -- If we got the render Target of the screen then RTE_Demo = RTE RTE_Holo = holoscreen addEventHandler ( "onHoloScrenRender", RTE_Holo,drawHoloDemo) -- Event handler for every render of the holo screen end end ); function drawHoloDemo() local width, height = dxGetMaterialSize(RTE_Demo) local sW, sH = dxGetMaterialSize(RTE_Demo) dxSetRenderTarget(RTE_Demo,true) -- function isMouseWithinRangeOf(posX, posY, sizeX, sizeY) if isCursorShowing() == false then return false end local cx,cy = getCursorPosition() cx,cy = cx*sW,cy*sH if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then return true,cx,cy else return false end end boxes = { {x = sW/2-sW/10, y = sH/2-sH/7.4+sH/18, w = sW/5, h = sW/5, borderColor = tocolor(0, 200, 255)}, {x = sW/2-sW/6, y = sH/2-sH/7, w = sW/3, h = sH/20, borderColor = tocolor(0, 200, 255), boxD = "aqua", text = "Hi There", messageBox = "1"}, } buttons = { {x = boxes[2].x + boxes[2].w - sW/47 - sW/13, y = boxes[2].y + boxes[2].h - sH/14, w = sW/13, h = boxes[2].w/6.5, color = tocolor(255,255,255), borderColor = tocolor(0, 224, 224), text = "Click Here", func = "pressLogin"}, } for i,b in ipairs(buttons) do dxDrawRectangle(b.x ,b.y ,b.w,b.h,b.color) dxDrawRectangle(b.x , b.y , b.w, 1, b.borderColor) dxDrawRectangle(b.x , b.y , 1, b.h, b.borderColor) dxDrawRectangle(b.x, b.y + b.h , b.w, 1, b.borderColor) dxDrawRectangle(b.x + b.w, b.y , 1, b.h, b.borderColor) if b.text then dxDrawText ( b.text, b.x , b.y , b.x + b.w , b.y + b.h , tocolor(31,31,31), sW/1600, "default", "center", "center") end if isMouseWithinRangeOf(b.x , b.y , b.w, b.h) then dxDrawRectangle(b.x ,b.y ,b.w,b.h,tocolor(0,255,255)) if b.text then dxDrawText ( "Now Release", b.x , b.y , b.x + b.w , b.y + b.h , tocolor(255,255,255), sW/1600, "default", "center", "center") end end end local ix = getElementData(RTE_Holo,"ix") local iy = getElementData(RTE_Holo,"iy") if ix and iy then local tx = ix*width local ty = iy*height dxDrawLine (tx-13,ty, tx+13,ty,tocolor(255,0,0,255),1) dxDrawLine (tx,ty-13,tx,ty+13,tocolor(255,0,0,255),1) end -- dxSetRenderTarget() end
-
The samt2497's resource takes care of that. What the function i use ?
-
Hi Guys, Today i tried to make panel but with Holoscreen of samt2497 https://github.com/samt2497/mta-holoscreen i tried to make a button (if the mouse is range of the button than change color) but it won't work here is code on Demo File : RTE_Demo = nil RTE_Holo = nil myFont = dxCreateFont( "fonts/opensans-light.ttf", 15 ) or "default" addEventHandler( "onClientResourceStart", resourceRoot, function ( startedRes ) local holoscreen,RT_ID,RTE = createHoloScreen(149,2482,18,0,0,90,6.5,7) --Create our holoscreen setElementData(holoscreen,"interactive","aim") -- Make it interactive on user aim if RTE then -- If we got the render Target of the screen then RTE_Demo = RTE RTE_Holo = holoscreen addEventHandler ( "onHoloScrenRender", RTE_Holo,drawHoloDemo) -- Event handler for every render of the holo screen end end ); function drawHoloDemo() local sW, sH = dxGetMaterialSize(RTE_Demo) dxSetRenderTarget(RTE_Demo,true) -- boxes = { {x = sW/2-sW/10, y = sH/2-sH/7.4+sH/18, w = sW/5, h = sW/5, borderColor = tocolor(0, 200, 255)}, {x = sW/2-sW/6, y = sH/2-sH/7, w = sW/3, h = sH/20, borderColor = tocolor(0, 200, 255), boxD = "aqua", text = "Please Log In", messageBox = "1"}, } buttons = { {x = boxes[2].x + boxes[2].w - sW/47 - sW/13, y = boxes[2].y + boxes[2].h - sH/14, w = sW/13, h = boxes[2].w/6.5, color = tocolor(255,255,255), borderColor = tocolor(0, 224, 224), text = "Log In", func = "pressLogin"}, } for i,b in ipairs(buttons) do dxDrawRectangle(b.x ,b.y ,b.w,b.h,b.color) dxDrawRectangle(b.x , b.y , b.w, 1, b.borderColor) dxDrawRectangle(b.x , b.y , 1, b.h, b.borderColor) dxDrawRectangle(b.x, b.y + b.h , b.w, 1, b.borderColor) dxDrawRectangle(b.x + b.w, b.y , 1, b.h, b.borderColor) if b.text then dxDrawText ( b.text, b.x , b.y , b.x + b.w , b.y + b.h , tocolor(31,31,31), sW/1600, myFont, "center", "center") end if isMouseWithinRangeOf(b.x , b.y , b.w, b.h) then dxDrawRectangle(b.x ,b.y ,b.w,b.h,tocolor(0,255,255)) if b.text then dxDrawText ( b.text, b.x , b.y , b.x + b.w , b.y + b.h , tocolor(255,255,255), sW/1600, myFont, "center", "center") end end end local ix = getElementData(RTE_Holo,"ix") local iy = getElementData(RTE_Holo,"iy") if ix and iy then local tx = ix*sW local ty = iy*sH dxDrawLine (tx-13,ty, tx+13,ty,tocolor(255,0,0,255),1) dxDrawLine (tx,ty-13,tx,ty+13,tocolor(255,0,0,255),1) end -- dxSetRenderTarget() end function isMouseWithinRangeOf(posX, posY, sizeX, sizeY) local sW, sH = dxGetMaterialSize(RTE_Demo) if isCursorShowing() == false then return false end local cx,cy = getCursorPosition() cx,cy = cx*sW,cy*sH if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then return true,cx,cy else return false end end
-
You can use that function : function isMouseWithinRangeOf(posX, posY, sizeX, sizeY) if isCursorShowing() == false then return false end local cx,cy = getCursorPosition() cx,cy = cx*sW,cy*sH if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then return true,cx,cy else return false end end
-
How did you check if cursor is Range of the buttons or the holoscreen ?! Please Can you tell me ? anyway you Did a Nice Job
-
Perfect ! is it really that is going to get added into MTA:SA Official Resource Pack ?!! Hope that happend
-
i need help with triggering Event with a table from Server to Client ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
