![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Dealman
Members-
Posts
1,421 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Dealman
-
Read about the functions and events TAPL just provided you thoroughly and you'll be able to figure something out. You can't live on examples all of your life, eh? Give it some time, test things out. Scripting and programming involves a whole lot of trial and error, see what you can come up with and we'll help you from there buddy Just think of it logically, write it down if you think it helps. Say you want to create a button: 1. First you'll need a way to check if the cursor is currently within the area. For this you can use Castillo's function isMouseInPosition (I renamed it to isCursorWithin). 2. Secondly, once you have a way to check if the cursor is within the button's area, you'll need to detect whenever the mouse is clicked. onClientClick should do the trick! Remember to read about the parameters it passes to your function. 3. Thirdly, use those together and use outputChatBox to see if it works. It should only output a message if you click within the button's area. Editboxes are a bit tougher to make, so start with the button.
-
Dewu, read the wiki pages about triggerClientEvent and triggerServerEvent more thoroughly. For example, if you create a object via the server, and you want a client(or more than one) to do something with this element - you need to pass the data, like this; triggerClientEvent(whoToSendTo, "TheEventName", resourceRoot, Data1, Data2) For example you can use either root or resourceRoot as the first argument, this will trigger the event for all players currently on the server. Or, you could specify specific player elements. Then client-side you have to fetch this data, and you do that via the function; function exampleCode(Argument1, Argument2, Argument3) Here, Argument1 will be whatever Data1 is. Argument2 will be whatever Data2 is - and Argument3 will return nil. I'm sure you can figure the rest out by yourself from here on.
-
Your function is not retrieving the sent data; function sbros(drop)
-
It also depends on what you're saving. For example if you save the player's position, rotation, interior, dimension, money and etc - you'll be fine to save it every 10-15 minutes or so. You can also add the option for the player to force save, and add a cooldown so they can't spam it. Don't be too shy, SQL databases tend to be underestimated.
-
There is no "best way". People have different ways of learning and it is up to you to decide what you like the most. Personally, I like to learn via trial and error; it can and will be frustrating at times. But by doing this, you'll learn how to try to fix it yourself, rather than ask on a forum as soon as an issue arises. Start with a small project, get familiar with client-sided code and then take it from there. Start with outputting messages, play around with how elements and element data work Most importantly; Get used to navigating the MTA Wiki, being able to find functions or events to accomplish what you want is crucial. It may not sound like much of an advice, but this is how I started and got myself into scripting and programming.
-
Well obviously it won't, you're trying to take money away from the vehicle element. You need to specify the player element. You can use getVehicleOccupant or getVehicleOccupants to find what other players are in the vehicle. Seat ID 0 should be the driver, go from there.
-
Are you looking to make something like a dynamic texture? Similar to this?
-
Did you make any adjustments to their material in 3ds Max? Select all the faces of the lights and make sure you assign the proper GTA Material to them.
-
Would be helpful if you could link us to the same models you are using so we could test this on our end and maybe find the cause.
-
If it truly doesn't work, I guess it could be some memory issue. Avoid using a lot of ridiculously over-sized models and textures. However, that said, there is something wrong with model replacing for sure. I've modded in a few vehicles into MTA myself, and randomly(albeit rarely) they will sort of lose their suspension setting or something. They just slide along on the ground. Similar to when you give hydraulics to the monster truck - except the wheels look fine. Absolutely no clue what causes it.
-
Most certainly! getKeyState
-
Rather than accusing one another and calling names, if you do find it suspicious, you're probably just better of reporting the thread and letting a moderator look into it. No-one cares about you comparing your e-peen sizes, there was nothing other than childish arguments in this thread.
-
Okay here's a quick example I made, it was made using absolute values for 1920x1080 so if you use a smaller resolution you'll probably have to make it relative. This is only to serve as an example, therefore, things are not working optimally, there's a lot of things to still do, but it will demonstrate how to do the basics of a scrollbar.
-
So it does... You need the position relative to the rendertarget?
-
If you want it to look more professional, make sure the padding are the same. For example, the left button is closer to the left edge than the right button is to the right edge.
-
You can do it like this; local prisonCells = { {1572.83984375, -1637.4758300781, -83.001655578613, 6} } for i, v in ipairs(prisonCells) do local posX, posY, posZ, theInterior = unpack(v) setElementPosition(playerElement, posX, posY, posZ+1) -- Add 1 or 2 to Z Axis so the objects can load. setElementInterior(playerElement, theInterior) end
-
You're misunderstanding the messages. It said it expected an element, this implies it got something else; A string, a boolean, a float or integer value - something that is not an element. Thus, the issue was that player was not defined and likely returning nil. The messages are not coloured? Is the hex colour-code removed from the status/name?
-
Are you sure player is returning a player element? getElementData returns false if it was unable to retrieve a value, false is a boolean - not a string. Also, for optimizations, you should try to avoid doing 'hardcoded' calculations in drawings. You'd be better of doing the calculations once instead of 30-60 times a second, unless it's for some animation
-
I agree that getCursorPosition is pretty bad, it needs have a boolean added to it so it can return both relative and absolute. That said, you can still use relative values as effectively as absolute values, in fact, I'd rather use relative values as it'll work on all resolutions. onClientMouseMove returns absolute X and Y.
-
So basically, you don't want to learn how to solve it - you just want us to do it for you...? In that case, good luck
-
addEvent("onClientDXSBClick",true) function dxScrollBarMove(element) if (isCursorShowing()) and getElementData(element,"isMoving") then local x,y = getCursorAbsolute() --setElementData(element,"x",x-getElementData(element,"Move:x")) dxScrollBarSetScroll(element,(y-getElementData(element,"Move:y"))) outputChatBox(y) end end Is it this part that doesn't work? We can't really help you when you're barely giving us any detail. Are you sure getCursorAbsolute works? What does it output? You're telling us nothing other than "it doesn't work". You need to help us, for us to help you You can't expect us to magically understand how your code would behave in-game. Just be patient, you'll get help eventually.
-
Very impressive! How's the performance impact when using ridiculous values/amounts of particles?
-
I might take a look at it later buddy, but there's a lot to go through, and when people merge their functions into the event handlers like that it just gives me a headache to read. You're really better of just naming the functions Does it do anything or is it not working at all?