Dealman
Members-
Posts
1,421 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Dealman
-
I wasn't too impressed, I was expecting individually fine-tuned settings for the vehicles. Instead you're just multiplying their default handling by hardcoded values. Anti-lock brakes aren't realistic, all they do is just prevent you from braking so you have to use the handbrake instead. You can download my prototype ABS resource if you'd like. It's a little project I was working on a while back, so it's not finished. Type /abs after you've started the resource to edit the settings. Edit: Didn't realize I had compiled that one as I rarely compile my resources, especially not prototype one. If you're interested I'll try and dig up the original.
-
Since it is a number, then this should work just fine; setElementData(v, "R", tostring(math.round(select[1].r, 2))) That should show up as 0.42.
-
Well since you're not giving us enough information, go ahead and try this; setElementData(v, "R", tostring(math.round(tonumber(select[1].r)), 2))
-
Is it a number or a string? Seeing as how it doesn't work and your float value has a comma instead of a period - I'll go ahead and assume it's a string. I assume that function doesn't work with strings.
-
For a smooth transition you'll need to use a render target, and draw the text on it. Then simply move the text upwards or downwards. Anub's method is easier to do, but it will look choppy and you can't really control the scrolling as easily.
-
I'd use gsub, you can find the patterns/regular expressions here. Just have gsub remove the unwanted characters the exact same way you do with colour codes
-
It's really simple. If you want to colour the entire string, use the tocolor() attribute of dxDrawText. This attribute has 4 values, Red, Green, Blue and Alpha. They range from a value of 0 to 255. You can also use hex code, IE, if you want 255 green - you would do #00FF00. I'd recommend you use websites such as colorpicker.com. Also, read about dxDrawText, you have a boolean for whether it should accept hex colour-codes in the string or not.
-
Insert the data into a table using table.insert. Then run a for loop through the table to calculate the final cost, and what weapons and ammo should be added.
-
Clip in dxDrawText will not render text that is outside the boundaries. Also, you can't use the clip and colour-coded attribute at the same time. Do also note that you can use dxCreateRenderTarget as well.
-
It's a simple design, but gets the job done. I prefer darker themes than white ones like Trani suggested, it's more easy-going on your eyes Maybe try to make some design via Photoshop or whatnot? Always good to practice a little photoshop
-
This project is discontinued until Notepad++ updates UDL to better support Lua. I might still do some minor edits to the GitHub repository if I find something.
-
Sure there is, you could use setElementData for example. Make a data value for the vehicle called "numberOfGluedObjects" or whatnot, increase the value every time something is glued to something. And if the number is greater than whatever you want it to be, do not glue them. I don't know the functions of the resource you're using, or if they're even exported - so you'll have to figure that out yourself.
-
How are you triggering the event replaceclient?
-
I don't mean to de-rail your topic, but my reply is not self-promotion - you might wanna look up the definition of that term before you throw it around. I quoted myself because he's been bickering about it for a while, and it might be useful for others. How is trying to help self-promotion?
-
On the contrary, your code is wrong. The rendering is not bugged, I made an example earlier on how to make a scrollbar - it did not lag. Since you don't seem to know how to search, here you go;
-
The idea is nice and it's perfectly doable, I even have some ideas for making modular building a reality, with snapping - but I have more important things to work on before I get to that. I'd suggest you look into SQL, it's not too hard to get into. If you can make scripts for Lua, you can learn how to manage a SQL database.
-
I answered a topic regarding scrollbars, and I provided a working example which does not lag - search for it and you'll find it. OT: It's a nice, simple yet sleek design. Personally, I prefer to have buttons on the right side, rather than the left.
-
Just noticed I forgot to update the variable too, my bad; local isButtonOn = false; function click() if (source == onoff and isButtonOn == false) then guiStaticImageLoadImage(onoff, "img/on.png") isButtonOn = true elseif (source == onoff and isButtonOn == true) then guiStaticImageLoadImage(onoff, "img/off.png") isButtonOn = false end end addEventHandler("onClientGUIClick",root,click) But maybe you figured it out already
-
More specifically, you'll want to use this example; function getPositionFromElementOffset(element,offX,offY,offZ) local m = getElementMatrix ( element ) -- Get the matrix local x = offX * m[1][1] + offY * m[2][1] + offZ * m[3][1] + m[4][1] -- Apply transform local y = offX * m[1][2] + offY * m[2][2] + offZ * m[3][2] + m[4][2] local z = offX * m[1][3] + offY * m[2][3] + offZ * m[3][3] + m[4][3] return x, y, z -- Return the transformed point end To get the co-ordinates behind the vehicle, simply do something like this; local vX, vY, vZ = getPositionFromElementOffset(0, -1, 0)
-
The first if statement will always be true, it will never run the 2nd one. You'll have to assign a variable; local isButtonOn = false; function click() if (source == onoff and isButtonOn == false) then guiStaticImageLoadImage(onoff, "img/on.png") elseif (source == onoff and isButtonOn == true) then guiStaticImageLoadImage(onoff, "img/off.png") end end addEventHandler("onClientGUIClick",root,click)
-
I know what he wants to do, I simply corrected his mistakes. I've been working on a similar resource from time to time, which lets one player enter as a gunner in a vehicle, where he can control the gun, look around and fire etc. I've been meaning to look into releasing it, but it needs more work still.
-
Xwad, you're trying to use server functions in a client-side script. This will not work. Also, you're getting the element position of the player, not the vehicle. Also, you're only storing the X co-ordinate, not the Y and Z co-ordinate. You need to make it something like this; local vX, vY, vZ = getElementPosition(getPedOccupiedVehicle(localPlayer)) This gets the position of the vehicle the local player is using. setWeaponProperty, getRandomPlayer, giveWeapon and setWeaponAmmo are server-side functions. After this I have no idea what you're trying to do, I can't tell if you messed up your paste, but you haven't made any functions - only if statements. There are several solutions to fire the weapon, you could have a check in a timer or a render event to check if the left mouse-button is being held down using getKeyState. Or you can use the function bindKey or the event onClientClick. Take some time and read the MTA Wiki thoroughly, it will be your best friend once you learn how to navigate it to find what you need.
-
Don't really think anyone here hates you Deepu, they've just had it with your childish and arrogant behavior. As soon as anyone criticized any of your scripts, you got offended and started throwing insults around. You've already said on multiple occasions that you're back and you won't get into fights again, but you keep doing it. Learn to appreciate feedback, whether it's good or bad. If you're a scripter/programmer or developer and can't take criticism - you won't get far. Also, creating a new account to post feedback on your own resource - like Solidsnake mentioned is very pathetic.
-
You called your button variable bSumbit, not bSubmit.
-
MTA Blue does not support addition of models, only replacement of already existing ones. MTA Eir will/already does support addition of models.