![](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
-
Sorry, missed that. It looks ay-okay. That should trigger for all clients though. What if you put a message there, is the function "hudChanger" being executed at all?
-
Well then it's obvious, isn't it? It's the server-side code that's likely to be messed up. And we can't assist any further if you don't post that part of the code.
-
And once again I have to explain this. @ReX; You need to understand what onClientRender does. This event will trigger the attached function once EVERY FRAME. This means, if your game is running at 60 FPS, you'll be executing ALL of that function, 60 TIMES PER SECOND. And you're asking us why it's lagging? You could always make a command to toggle the HUD on and off to allow players to decide whether they want it or not. Something like this might work, Client-Side;
-
DX Drawings do not return a element, thus, you can not make use of functions like destroyElement. You'll have to rely on the onClientRender/onClientPreRender functions and adding/removing event handlers.
-
Am I the only one that don't see being admin as a privilege/promotion? Being an admin means even more work, since you'll have to help players in need and monitor players in case of cheating/exploiting. Being an admin is hardly a perk.
-
If you're like me, and hate math. You could simply make use of a similar workaround as I do. I simply create a regular GUI with the same shape as my DX Drawings, then set its alpha to 0. That way I can manipulate my DX Drawings using the already available GUI Functions/Events.
-
First error means you're trying to do some calculation on a boolean(true or false) value. Second error means that you're trying to get the position of something that isn't a valid element. Can't really help unless you provide relevant code.
-
I have absolutely no idea what you are doing. Why are you checking if it's an element? And why are you trying to destroy it? DX Drawings do not create any elements except for a select few functions such as dxCreateRenderTarget. You need to use either onClientRender or onClientPreRender to draw DX Drawings as they are only drawn for one frame. For example, Toggle Command; (Client-Side)
-
You can using the Admin Panel, but you have to reload the ACL for it to have any effect. Which also requires ACL Access. You can do it via the server console if you host the server via your computer. Edit: I believe the console command is as follows, aclrequest allow admin all
-
Should work with; attachElements
-
As far as I know DX Functions don't create any elements, except for a select few. Such as making a shader/render target. So you'll have to rely on variables.
-
This should do it for client-side; showCursor(true, false) First boolean is for whether to show or hide the cursor itself. Second boolean is whether you want to enable or disable locked controls while cursor is active.
-
Not entirely sure if you can do that. Why not just write it like demonstrated?
-
Not entirely sure what you're asking. But I'm assuming you want to be able to add and/or remove an event handler from a function. Simply write it like this; function exampleCode() if(Something == SomethingElse) then removeEventHandler("SomeEvent", getRootElement(), exampleCode) end end addEventHandler("SomeEvent", getRootElement(), exampleCode)
-
I have already achieved what I wanted. The method suggested by Dakilla worked surprisingly well with some tweaks. Basically create the object, and then a vehicle(client-side) at the same location, attach the object to the vehicle and apply velocity to the vehicle. You then simply destroy the vehicle and the object will have its physical properties enabled. Just some trigonometry needed to make sure it's sent straight forward at all times.
-
Thank you, but a friend helped me spot what I did wrong. Had coolBarNow instead of coolBarStart. x)
-
As I'm working on my new shooter, I decided to add a DX Progress Bar for the reloading, and use interpolateBetween to animate it. However I have encountered something rather odd. Either I've missed something blatantly obvious, or I've found a bug with interpolateBetween... Relevant Code; Problem; It's supposed to go from right, to left - and then when it reaches the far left(0) it should go back to the right again. However, the first stage is behaving very weirdly. If I use the variable, barWidth it goes from full to empty, way too fast. However, if I use the actual calculation(screenX*(485/1360)) - instead of the variable, it moves much slower - but only reaches 50% and then it starts the 2nd stage. What's weird is that barWidth should be the exact same as the actual calculation, as it's defined at the top of the script. And not changed anywhere else. I've tried various durations and things but I can't pin-point what's causing this. The 2nd stage seems to be working as intended. Can anyone spot what I have missed? Or is this some sort of bug with interpolateBetween...?
-
Unfortunately you can't, you'll have to use guiLabelSetColor which colours the entire label. You can however make 2 labels as a workaround.
-
Dear Diary, I have tried a method suggested by a forum member by the name of DakiLLa. So far, the test results have been varying. It seems like it might work. I am currently trying to find a vehicle that is of appropriate size, and immediately after creation - set its alpha to 0 and remove it. It seems like the object then get its physics enabled since it's already in motion. However, it does not seem to be doing what I want it to do... Yet. More testing is needed. I remain curious as to what the results will be. -- End of Silly Mode -- Edit: It would seem as though the object needs to be frozen for it to work like intended. I am rather confused. I might have to use moveObject after all, or apply force on collision manually via a function. Decisions decisions.
-
No, they don't but that's a whole other thing though. If I were to use moveObject, that would mean objects can move straight through other objects. Unless I make some unnecessarily complex workaround for it to be destroy if it enters some other object. And I don't want my objects to explode. The whole point is for the object to interact with the surroundings, which physics objects do. I just need a way to toggle their physics. I guess it could work, I'll give it a try later to see how it behaves.
-
I don't think you quite understand what I'm trying to do. Either way, I tried to create the object server-side to then use getAllElementData on the object to see what datas it had, in case anything would be related to the physics. However, this function doesn't seem to be working at all, at least not for objects. Doesn't return anything.
-
Some objects in GTA have physics, but they are disabled when you create the object. The physics are first enabled when the object is interacted with. IE, the barrels have physics.
-
It won't work as well with moveObject though, since it's basically like interpolateBetween. The object will just move from Point A to Point B in a straight line - it won't look like it has physics at all. Just stale, and awkward. It should be possible to use setElementVelocity on objects, as stated by the wiki. But the MTA Devs probably didn't think it through with physics objects - dunno... Edit: Noticed that the object's mass when created is -1. I tried to set it to a proper value, physics remain toggled off for the object. Is there any way whatsoever to toggle the physics other than ramming the object...?
-
I'm trying to create something similar to shooter, but in that you can fire objects instead. However, I seem to have hit rock bottom. And I believe the issue is because they are physics objects and because of how MTA handles them. Whenever a physics object is created, it's frozen solid in the place it was created. And physics won't be enabled until something hits the object. And as such, I can't seem to use setElementVelocity on that object - it doesn't move at all. And yes, it's created Client-Side, so setElementVelocity should work on objects. It's even more troublesome because there ain't no function, at least as far as I'm aware to enable the physics. Unless there's some element data for it - which I doubt. I've tried to use these functions; setElementFrozen setObjectBreakable But neither of them seemed to toggle the physics on the object. Any help regarding this would be greatly appreciated...!