-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
Afaik different shaders aren't linked. The only thing I learned from shaders is that tocolor behaves different when using shaders. Put it on 255, 255, 255 and let the shader do the rest. This might also giving some problems if the shader isn't handling it right: currentHealth = (theHealth-250)/750 >>>> 0 health > -250 > / 750 > * 180 = -60 if currentHealth < 0 then currentHealth = 0 end
-
That is a good question. But it isn't about checking if something is between to elements. It is about checking if a position(colshap) is between a line(shooting line). https://wiki.multitheftauto.com/wiki/OnClientPlayerWeaponFire Parameters int weapon, int ammo, int ammoInClip, float hitX, float hitY, float hitZ, element hitElement, float startX, float startY, float startZ Start line | | | ( Colshape ) | | | End line The getDistanceBetweenPointAndSegment3D function I gave you calculates the distance between a line and a point. If the distance is smaller than the colshape size, it is a hit.
-
Wiki knows: https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions#Edit_Fields
-
I just gave you a solution for detecting shooting in round colshaps, be happy with it...
-
If is it a round colshape:
-
Too much code, what do you expect? I am not even going read it. The scoreboard will only update when the elementdata is changed. So at every place the gui is changed you have to set the elementdata.
-
invisibleAdmins = {} iprint(invisibleAdmins) -- table (empty) Interaction with the table: invisibleAdmins[getPlayerSerial(player)] = true iprint(invisibleAdmins) -- table {["<serial>"] = true} After using this: invisibleAdmins = invisibleAdmins[getPlayerSerial(player)] iprint(invisibleAdmins) -- true You just deleted your table. (not good) Solution: local isInvisible = invisibleAdmins[getPlayerSerial(player)] iprint(invisibleAdmins) -- table {["<serial>"] = true} iprint(isInvisible) -- true
-
Check the examples of this function: https://wiki.multitheftauto.com/wiki/GetElementMatrix No complex math required. Just getting 2x the offset of the vehicle and using it as camera start and end point.
-
Better not knowing, it is a computer notation which is not very useful for us humans. And it is the raw output after all. Better save RGBA in a table as input and use that. The only reason for learning this notation is if you are working with a complexes non script language, where that knowledge is required.
-
Yes, that can affect it. As freezing/unfreezing elements client-side isn't synced with other players. And even you did unfreeze it for all clients without serverside, I wouldn't know how the server would manage that.
-
The same issue occurs sometimes with new spawned peds, except the re-sync happens eventually after some seconds. Might that be related? (The problem might be located in the bandwidth reduction, it is the perfect place for that to happen in my opinion.)
-
I wonder what happens if you set the dimension of the camera element: https://wiki.multitheftauto.com/wiki/GetCamera (experimental)
-
For not scripts: (as title says) https://wiki.multitheftauto.com/wiki/TeaEncode
-
I would indeed consider that a MTA bug, (if the trailer is serverside and synchronization is enabled) What happens here is that the server for some reason doesn't assign a syncer(player) to the trailer. So no player tells the server where the trailer is located. And because of that, it is also not sending its location to the clients. If the server did stream this location, the trailer might get stuck in the ground because the server doesn't know where the floor is located. One of the main issue's with trailers is that they can't be driven.(afaik) Normally if a player enters one of the seats, the server clearly knows which player is responsible for streaming the vehicle position.(driver seat has priority)
-
eliminate the body when dying eliminate the body when dying
IIYAMA replied to xJulianGilx's topic in Scripting
Of course there is no function for all that. Because you must give lua a script to follow. And a script that does multiple things requires multiple functionalities > functions. So learn lua. Then mta syntax. After those two you can build it. -
eliminate the body when dying eliminate the body when dying
IIYAMA replied to xJulianGilx's topic in Scripting
You can't destroy a player element. You need to use the function: setElementPosition And how do you use that? > Do first some research yourself. -
Or move it to the dimension you want (clientside) https://wiki.multitheftauto.com/wiki/SetElementDimension
-
The table is fine, but the nodes aren't. Those nodes are nothing more than a reference to the real nodes in the xml, which are only available on the side where the xml is loaded. Loop through the table and get the real data with https://wiki.multitheftauto.com/wiki/XmlNodeGetAttributes https://wiki.multitheftauto.com/wiki/XmlNodeGetValue And send that.
-
In the description it didn't say that it wouldn't connect. Only that it de-attached directly after that. So maybe the effect is normal.
-
Does the event gets executed?
-
function job_trailerAttach(veh) cancelEvent() setElementVelocity ( source, 0, 0, 0 ) end addEventHandler("onTrailerAttach", getRootElement(), job_trailerAttach) or function job_trailerAttach(veh) cancelEvent() setElementVelocity ( source, 0, 0, 0.1 ) end addEventHandler("onTrailerAttach", getRootElement(), job_trailerAttach) (untested)
-
https://wiki.multitheftauto.com/wiki/OnTrailerDetach see example
-
The end effect is hackable. https://wiki.multitheftauto.com/wiki/ShowChat
