Dealman
Members-
Posts
1,421 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Dealman
-
Just use variables, simple. Here's 2 examples you can use; -- Method 1 local exampleVariable = 21 function ExampleCode() dxDrawImage(689, 280, 116, 115, "circlebar.png", exampleVariable) end -- Change the variable "exampleVariable" to something else -- Method 2 local shouldRotate = false function ExampleCode() if(shouldRotate == false) then dxDrawImage(689, 280, 116, 115, "circlebar.png", 21) elseif(shouldRotate == true) then dxDrawImage(689, 280, 116, 115, "circlebar.png", 90) end end Edit: Woot 1000th post
-
Think about it for a while, do some testing. Scripting and programming is a lot about trial and error, in fact, it's mostly trial and error. Can't expect to get everything served on a silver platter. It's all about logical thinking; Issue 1: You need to draw in 3D space. Solution: dxDrawLine3D, dxDrawMaterialLine3D or dxDrawMaterialSectionLine3D Issue 2: You need it to follow the vehicle. Solution: Get the vehicle's position in 3D Space - getElementPosition. Basically what you want to do is to get the vehicle's position and store it in a table. Then you draw whatever is stored inside this table. And to get the effect where it's removed after a certain distance you can either do by number of items in the table and remove the first item every time a new one is inserted. Or by time, which might be a bit more complicated. 1. Get vehicle position. 2. Store vehicle position in a table. 3. Loop through all items in the table, draw them. 4. Remove first item in the table if you want to. You'll also probably want to use onClientPreRender instead of onClientRender. Just give it some time, read through the MTA Wiki examples and I'm sure you'll figure something out. You shouldn't need any fancy trigonometry calculations unless you want to go over the top.
-
Basically this, also another downside of XML is that it can become rather slow. Whereas MySQL or SQLite if used properly should be extremely fast and efficient. Personally I prefer MySQL, but both get the job done.
-
Sorry but I haven't got the slightest clue what you're trying to say Also; showCursor(true) showChat(false) setPlayerHudComponentVisible("all",false) You really only need to do this once, why do you need to run this 30-60 times per second?
-
Or you can do it like this to make it look like it's flashing, a lot less code needed; local currentTick = getTickCount()/440 dxDrawRectangle(0, 0, 0, 0, tocolor(255, 255, 255, math.abs(math.sin(currentTick)*220)), false)
-
Yes, you can mute it and play your own audio. But this is no easy task. You can use setWorldSoundEnabled to turn off engine sounds. To make it sound good you'll need to edit the speed and pitch of the sound according to the engine's RPM(or only use speed if you're lazy). And simulating engine RPM is a whole lot of math.
-
I still haven't got a clue of what warping thing you're talking about, so I can't really help you
-
How does the warping work? Can they warp anywhere they want by entering the X, Y and Z co-ordinates or what? You can use collision boxes around the important areas such as bases. So if they warp inside they'll be warped elsewhere. Or you can check if the position is inside the box BEFORE they warp. Some more details on how it works would be useful
-
Stop the resource "voice". Should work unless all that does is draw the icons etc.
-
No idea what you're talking about, could you post a screenshot? Did you get my aiming script to work?
-
Yes you can call functions from another file in the same resource so long as they're the same type. Client <-> Client. And to call a function you need the paranthesises: doStuff().
-
...And what's the issue? If you want help you might as well post here, why should we go through the trouble of adding you on Skype only to help you...?
-
Oh lord
-
You can do this by using regular expressions(Google it). I'm on my phone at the moment so I can't give you and examples. But there should be plenty of related threads if you try and search. What I can say is that %d stands for digit. So if there is a number, it will be deleted. You can then mix this with + to get all the numbers. string.gsub(stringVariable, "%d+", "")
-
You can also write it like this in case you don't want to have a lot of if statements inside your function; dxDrawRectangle(661, 296, 19, 16, (isMouseInPosition(661, 296, 19,16) and tocolor(150, 0, 0, 200) or tocolor(0, 0, 0, 200)), false)
-
It's this function isMouseInPosition but he renamed the variables and seem to have forgotten to add this like; local sx, sy = guiGetScreenSize()
-
getElementsByType returns a table, therefore you need to loop through them. You'll want to read about for loops. Here's 2 examples on how you can do it; local allTeams = getElementsByType("team") if(allTeams) then -- If allTeams is not false or nil, then continue for key, value in ipairs(allTeams) do outputChatBox("Team #"..tostring(key)..": "..tostring(value)) -- Will output like this; "Team #1: BlueTeam", "Team #2: RedTeam" end else outputChatBox("Failed to retrieve teams!") -- If allTeams returned false or nil, this will be output. end -- Alternatively you can write it like this, but it's generally better to use if statements to catch errors and let the user know what went wrong. for key, value in ipairs(getElementsByType("team")) do local teamName = getTeamName(value) -- This will get the team name for each team in the table. outputChatBox(tostring(teamName)) -- You can use tostring in case it would return false or nil. end
-
You could simply freeze them and disable their collision if need be. Alternatively send them to another dimension as well.
-
What do you mean? Look at guiGetScreenSize for examples on how it works.
-
A quick look on the Wiki and you might have spotted setPlayerBlurLevel.
-
MTA doesn't natively support the GIF format. You can render a number of images after one another to achieve the same effect. Alternatively you can use the new browser functions introduced in 1.5. I assume you can look at .gif images using the browser.
-
You'll have to make a tank using several objects, usually 3(Hull, Turret, Barrel). Alternatively I think you can use vehicle components but I'm not entirely sure how they work. So you'd have to look that up. Barrel pitches up and down, Turret rotates along yaw. Barrel attached to turret, turret attached to the hull. If you use attachElements you can use setElementAttachedOffsets to rotate them relative to whatever they're attached to.
-
Create a 3D sound and attach it to the car, then you'll have to edit the pitch and speed of the sound cue to create the effect of reving the engine. I was working on something like this before, but I never finished it and don't think I will - it alters the sound effect depending on the engine's RPM, rather than speed.
-
Personally I'm not a big fan of the typical simplistic design, but looks good enough - at least you seem to have paid attention to spacing and all that - which is a very rare sight around here