-
Content Count
116 -
Joined
-
Last visited
Everything posted by AlvarO
-
I spoke too early, I started to script some minutes ago and after doing what you said I'm still having the same problem
-
Thanks you so much @Tut!!!
-
Hey guys, I'm having a problem since 2 weeks ago. The problem is, I'm playing MTA as always and there's no problem, it comes when i press ALT+TAB for changing of window for I don't know, check twitter, or changing music on spotify for example and I decide to return MTA. When I do it, MTA doesn't load, I can hear the sounds and everything but the video is not returning, when this happens, I go to task manager and close MTA. Is there any solution you can give me? Thanks.
-
OH, THAT IS WHAT I'M SEARCHING FOR!! Thanks for your time guys! SOLVED
-
Well, I know already about dgs' library, but the question is, is there any drawing function which makes the same? I mean, not using shaders.
-
Hello guys, I'm trying to draw rounded rectangle on my script, but the question is, is there a way to modify the curvature of the corners? I mean, there's default curvature, but I would change it. Long time ago, there was a function which has an argument to modify this. This is the code I'm using: function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end dxDrawRectangle(x, y, w, h, bgColor, postGUI); dxDrawR
-
Hello, what I'm trying to do is output the songname of an internet radio. showRadioSongname function is for show the message
-
I'm trying to add onClientRender event to a function for 5 seconds. When these 5 seconds has gone I want to remove it. This is what i made timer_1 = setTimer(showRadioSongName, 5000, 1) timer_11 = setTimer ( function() addEventHandler("onClientRender", getRootElement(), showRadioSongName) end, 5000, 1 ) if not isTimer(timer_1) and isTimer( timer_11 ) then killTimer( timer_1 ) killTimer( timer_11 ) removeEventHandler("onClientRender", getRootElement(), showRadioSongName) end
-
I used all the info that wiki shows, and I don't have anything: local dot = dxCreateTexture(1, 1) function dxDrawRectangle3D(x,y,z,w,h,c,r,...) local lx, ly, lz = x+w, y+h, (z+tonumber(r or 0)) or z return dxDrawMaterialLine3D(x,y,z, lx, ly, lz, dot, h, c or tocolor(255,255,255,255), ...) end addEventHandler("onClientRender", root, function() dxDrawRectangle3D(0,0, 30, 100, 100, tocolor(255,255,255,255)) end )
-
Try to use attachElements function
-
I modified what I wrote for you, and found that the problem is the animation, tried other one and works fine, here you have the code: function test(player, cmd, target) local targetPlayer = getPlayerFromPartialName(target) if targetPlayer then setPedAnimation(targetPlayer, "ped", "WOMAN_walknorm") else outputChatBox("Sorry, we don't know a person called " .. target, player, 255, 0, 0) end end addCommandHandler("xy", test) function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player
-
Try this: function test(thePlayer) local targetPlayer = getPlayerFromName (thePlayer) if targetPlayer then setPedAnimation(targetPlayer, "ped", "bom_plan", -1, false, false, false, false) else outputChatBox("Error, we can't find a player with that name!") end end addCommandHandler("xy", test) You should write the command as this: /xy <playerName>
-
onMarkerHit shows the DX Rectangle & Lines only for a second
AlvarO replied to thund3rbird23's topic in Scripting
I would use this: local marker = createMarker (0, 0, 0, "cylinder", 1.5, 255, 255, 0, 170 ) function playerJoinMarker() addEventHandler("onClientRender", getRootElement(), drawMarkerPanel) end addEventHandler( "onMarkerHit", marker, playerJoinMarker) function drawMarkerPanel() --YOU CAN DRAW HERE YOUR PANEL, ALSO, ADD A CLOSE BUTTON WHICH REMOVE THE onClientRender EVENT end -
I think you didn't understand me, i want to create from a square image to something like this: https://gyazo.com/ee82791a489032f9addf9fa5db69114e
-
I think this is your solution: guiSetVisible ( guiElement, state )
-
Hey, so I was just thinking and found no way to draw a rounded image, just came to my mind to postGUI an image with an empty hole, but well, is there a method to draw images rounded by itself?
-
GUI that is arranged to look the same on every resolution.
AlvarO replied to tommymaster's topic in Scripting
I usually use that trick: (In my case, my resolution is 1920 x 1080, so if you have any other resolution just change the values instead of yours.) local sX, sY = guiGetScreenSize() function drawRectangle() dxDrawRectangle((1770/1920)*sX, (25/1080)*sY, (100/1920)*sX, (50/1080)*sY, tocolor(0, 0, 0, 200), false) end addEventHandler("onClientRender", root, drawRectangle) But you said if there was a method that made it easier, only comes to my mind to do something like this: local sx, sy = guiGetScreenSize() local px, py = 1920, 1080 local x, y = (sx/px), (sy/py) function drawR -
Okay, post again if you have any question.
-
Try to decrease it while player is moving, so you have to use getElementPosition() and make a relation from the sound and the player and for x distance decrease it, its weird that it doesnt decrease by itself...
-
https://gyazo.com/38670ec19a7827ab1acf45f6df5dfc34
-
https://pastebin.mtasa.com/521315522
-
First of all, I never had a bug like this so its a bit strange, I've talked with many players of mta and nobody of them had this error/bug before. So the bug is that when im playing, it looks like im holding always the down arrow, but im not holding it and I don't know how to fix it, already changed from my new keyboard to other one and the bug is still appearing, it is a cumbersome to have a small playtime and you can't play in any MTA server, hope you guys help me with this.