Leaderboard
Popular Content
Showing content with the highest reputation on 20/01/21 in Posts
-
Hi MTA community recently I was browsing the useful functions list and I saw a new and interesting function available from version 1.5.8 r20704 onwards: attachElementToBone() and using the "onClientPedsProcessed" event. After seeing that this function gives better accuracy and better performance than 'bone_attach' resource I told myself why not making a new bonne attach resource, so this is what I did basically just using the function and the event I just created a synchronization between client and server with tables. Thank you to Einheit-101 and Saml1er for they’r hard work. Also thank you majqq for pointing me they’re credits! I called it attachToBones you can download it here: https://community.multitheftauto.com/index.php?p=resources&s=details&id=18372 GitHub (If you want to help): https://github.com/mihayy5/attachToBones It contains 2 server-side exported functions: attachElementToBone(theElement, thePed, boneID, offsetX, offsetY, offsetZ, rotationOffsetX, rotationOffsetY, rotationOffsetZ) theElement: The element which should be attached to the ped/player bone. Should work with any element that is supported by matrix functions. thePed: The ped or player which the element should be attached to. boneID: The target bone where the element should be attached to. offsetX: The X position offset from the bone. offsetY: The Y position offset from the bone. offsetZ: The Z position offset from the bone. rotationOffsetX: The rotation X-axis offset from the bone, in degree. rotationOffsetY: The rotation Y-axis offset from the bone, in degree. rotationOffsetZ: The rotation Z-axis offset from the bone, in degree. NOTE: rotationOffsetX, rotationOffsetY and rotationOffsetZ are automatically converted to radians! For a list of bone ID you can check the wiki page : attachElementToBone detachElementFromBone(element) element: The element which should be detached from the ped/player. VERY IMPORTANT ! THE OFFSETS ARE NOT COMPATIBLE WITH THE ONES FROM 'bone_attach' so you may have to rework all the positions. You can quickly test using those 2 test functions Code: /atest - to attach a sniper to player hand and a parachute to his back. /dtest - to detach them! Hope you find it useful! Cheers. P.S. PLEASE take note that I did not tested it with more than one player online so I will appreciate ALL feedback you can give!1 point
-
Utilize a função GetResourceOrganizationalPath para saber em qual pasta o resource está.1 point
-
1 point
-
1 point
-
Seems like restarting the resource causes the element datas to break. Adding a check on the side fixes the issue, but creates another issue, you gotta reenter your car after each resource restart. Also, I'm not sure how your code ran, as there is no "distance" value defined in your snippet. If it's needed, readd it in the line please. addEventHandler ("onPlayerVehicleEnter", getRootElement(), function (theVehicle, seat, jacked) if theVehicle and seat == 0 then theVehicle:setData("lastPos", theVehicle:getPosition()) end end) setTimer(function() for k, veh in ipairs(getElementsByType("vehicle")) do if veh then local pos = veh:getPosition() local vec = veh:getData("lastPos") if pos and vec and getUserdataType(vec) == "vector3" then local value = getDistanceBetweenPoints3D(vec:getX(), vec:getY(), vec:getZ(), pos:getX(), pos:getY(), pos:getZ()) if value then end end end end end, 2000, 0)1 point
-
Hello reader, and welcome to San Andreas Insane Network Server! -San Andreas Insane Network was created to give players chances , more chances everyday we are working as hard as we can for your entertainment.This server has been revived by a bunch of geeks. -SAIN:RPG is still up since 3 months and still going to grow up -SAIN:RPG Ip Adress: mtasa://51.195.143.165:27115 -SAIN:RPG Forum Link : Click Here -SAIN:RPG Discord Link: Click Here -On Our Forum you can find everything you need such as Rules & News & Recruitments -By the way we're looking for a new Staffs on SAIN team, if you think you're experienced enough,and you deserve that place fell free to appeal for it Now ! ,Dont Even Forget To Take a Look. -Question: How can I know the server rules and information? -Answer: Press F1. This panel has everything that you will be needing from the server. The rules, information, the job information how to work with them and why to work as it. -Question: How do I start a new job? -Answer: You visit a 'Save Icon'. There are found all around San Andreas. Press the map by pressing 'F11', the disc is blue and it should always be near you as there are many placed all around the San Andreas. Visit one, while standing on it, press 'H' to open the gui dialog. Look for 'Start New Life' it will kill you and the spawn will appear to spawn as something new. -Question: How do I purchase a vehicle? -Answer: You visit a 'Car Shop'. There founded on LS, SF and LV. Press 'F11' to open the map, on the map there is going to be a blue vehicle blip (or on your radar if you're near), go to the vehicle blue blip and there is going to be a marker. By going to that marker will display the carshop system which allowing you to purchase a vehicle depending on the amount you have. -Question: How do I purchase a house? -Answer: To purchase a house you must have the amount of money the house is wanting for. The money can be on hand or in bank when purchasing the house. To know if you can purchase the house they will be listed on 'M', 'Houses for sale' or the Icon will be green. Get near the icon, press 'H' and search 'Purchase House'. When you successfully purchase the house, the following things can be placed at it: -Vehicle Donations. -Interior Donations. Also, when spawning, you may spawn at your house by clicking the house name of which house of your's you would like to spawn at. Please know they are some rules regarding of where you can spawn and where you can't. -Question: When vehicle purchase, where can I spawn it to use it? -Answer: The vehicle is added to save icon. You must visit a save icon, when you do, press 'H' to open the housing dialog. Press 'Vehicles' and all vehicles purchased by you are placed there. Showing the vehicle damage, fuel, and model. -Question: How can I earn money? -Answer: There is alot of ways to earn money. There is few spawns which has a restricted job that you have to do in order to earn money. F.g. Trucker; You have to enter a roadtrain, go to the 'T' select your load to deliver and start deliver it to the deliver point and earning money depending on the load you choose. -SAIN Login |-| F1 Panel [HELP Panel] - -SAIN Jail Map- -SAIN Store Robbery |-| Gift Bag |-| Cars Shop & Cars Show |-| Bank -1 point
-
1 point
-
This server still goes strong after all these years! @Einheit-101 epic server!1 point
-
1 point
-
Nazwa: Quis 3D Text Labels Wersja: 1.1 Screeny: Screen 1 Screen 2 (zielona etykieta ma nadany indeks 1) Screen 3 (etykieta przyczepiona do naczepy) Przydatne informacje: Utworzone etykiety są elementami MTA, tak samo jak praktycznie wszystko co istnieje w MTA, czyli gracze, pojazdy, pickupy i inne. Typ elementu, dla etykiety to "text3d". Rozmiar tekstu dla każdej etykiety tekstowej jest skalowany w zależności od odległości od gracza. Im dalej, tym tekst będzie mniejszy. Lista zmian w wersji 1.1: poprawiono błąd, który powodował że nie dało się ustawić wartości "checkLOS" na false. Błąd ten został też poprawiony w wersji 1.0, godzinę po jej wystawieniu dodano czarną obwódkę do etykiet, dla ładniejszego wyglądu dodano funkcje attach3DTextLabel i detach3DTextLabel umożliwiające przyczepianie etykiet do innych elementów dodano parametr "index" w create3DTextLabel Lista funkcji (tylko server-side): text3d create3DTextLabel( string text, float posx, float posy, float posz, [ int red = 255, int green = 255, int blue = 255, float drawdistance = 100.0, bool checkLOS = true, int index = 0 ] ) Tworzy nową etykietę tekstową i zwraca jej element. Funkcja automatycznie konwertuje wszystkie zmienne jeśli ich typ jest nieprawidłowy, jeśli konwersja się nie powiedzie, zwraca "false". text - ciąg znaków, który będzie zawarty w etykiecie posx - pozycja X etykiety posy - pozycja Y etykiety posz - pozycja Z etykiety red - ilość koloru czerwonego w kolorze etykiety, domyślnie 255 green - ilość koloru zielonego w kolorze etykiety, domyślnie 255 blue - ilość koloru niebieskiego w kolorze etykiety, domyślnie 255 drawdistance - z jakiej odległości ma być widoczna etykieta, domyślnie 100.0 checkLOS - czy w przypadku generowania etykiety, ma być sprawdzana linia wzroku (Line-Of-Sight), tzn. czy etykieta nie jest za jakimś obiektem. Domyślnie true. index - taki jakby priorytet, im wyższy indeks, tym etykieta będzie generowana "wyżej" na stosie. Tzn. jeśli w jednym miejscu na ekranie nakłada się kilka etykiet, to na wierzchu będzie ta z najwyższym indeksem. bool set3DTextLabelText( text3d label, string text ) Zmienia tekst etykiety tekstowej. Zwraca true gdy operacja się powiedzie, false gdy podano nieprawidłowe parametry. string get3DTextLabelText( text3d label ) Zwraca aktualny tekst zawarty w etykiecie tekstowej. bool set3DTextLabelColor( text3d label, int red, int green, int blue ) Zmienia kolor etykiety tekstowej. Zwraca true gdy operacja się powiedzie, false gdy podano nieprawidłowe parametry. int, int, int get3DTextLabelColor( text3d label ) Zwraca kolor etykiety tekstowej w postaci trzech liczb. bool attach3DTextLabel( text3d label, element theElement, [ float offsetX = 0.0, float offsetY = 0.0, float offsetZ = 0.0 ] ) Przyczepia etykietę do innego elementu. Dane są konwertowane na prawidłowy typ, tak jak zawsze. Jeśli konwersja się nie powiedzie, funkcja zwraca "false", a w przypadku powodzenia "true". label - etykieta tekstowa, która ma zostać doczepiona theElement - element, do którego ma zostać doczepiona etykieta tekstowa offsetX - odległość X względem pozycji elementu offsetY - odległość Y względem pozycji elementu offsetZ - odległość Z względem pozycji elementu bool detach3DTextLabel( text3d label ) Odczepia etykietę tekstową od elementu, etykieta wraca na pozycję ustaloną przy jej tworzeniu. Zwraca "true" w przypadku powodzenia, "false" w przypadku błędu. Ta funkcja jest równoznaczna z: attach3DTextLabel(label, nil) Inne funkcje: Ponieważ etykieta tekstowa jest elementem, działa na nią także mnóstwo innych funkcji, wbudowanych w MTA. Przykłady: destroyElement, getElementPosition, setElementPosition Download: Tym razem spakowałem dwa pliki .lua w archiwum ZIP, myślę że będzie to wygodniejsze od kopiowania. Wystarczy wgrać te pliki do zasobu w którym chcemy używać etykiet tekstowych, dodać dwie linijki w meta.xml, i już możemy cieszyć się nowymi funkcjami. QuisTextLabels1_1.zip (Dropbox) Wersja 1.0: Kodu dużo nie ma, tak więc nie będę go nigdzie wstawiał. Skrypt można sobie wkleić do swojego zasobu, albo dodać jako nowy plik w istniejącym zasobie. Można też utworzyć całkiem nowy zasób, ale dostęp do funkcji będzie utrudniony (export). Server-Side: Client-Side: Będę robił aktualizacje, nie jest to ostatnia wersja, tak więc możecie zgłaszać bugi i propozycje, będę wdzięczny Miłej zabawy.1 point
