Leaderboard
Popular Content
Showing content with the highest reputation on 02/07/21 in Posts
-
Hi! Following the community discussion in our forums, we have created an official Discord server quite a while ago, as an alternative (and maybe a full replacement in the future) to our current IRC channels. We kept it in under the radar while we were fine tuning things, but we believe we can now present it to you guys. All MTA players and fans are welcome to join our Discord server (though please behave while you are in there ). You can join it by using this link: https://discord.gg/mtasa What is Discord? Discord is a hybrid of IRC, an Instant Messenger and a Voice Chat software. It incorporates the most important features of these elements into a handy and multiplatform app which you can run on your desktops, smartphones or tablets. Why is it cool? Compared to IRC, it offers a built-in chat history buffer, so even if you are offline, you can still catch up with what happened in the channels then. IRC also offers that, but only through an IRC Bouncer that you either need to pay for, or have someone host it for you. It also has a modern look and features such as URL embedding (regular websites, but also pictures and videos), handy syntax colouring for pasted code snippets, emojis (also custom ones), chat messages reactions, Steam integration and more. What can I find while I am there? We currently have some channels created, including: #general - for general MTA and offtopic chats #scripting - for Lua scripting-related queries #support - for any problems related to MTA:SA client or server #announcements - for all important messages from us as well as some others. We are still thinking of how to put our Discord server into its full potential, so we may add more channels soon. Can I have Discord app installed and/or running on several of my devices concurrently? Can I use more than one server? Sure, absolutely. It will sync the messages automatically. And yes, you can add more servers than just our one. How do I join it? Hey, we have mentioned that already. Just click the link below and follow the instructions: https://discord.gg/mtasa I have a suggestion about the Discord... Okay, let us know. As usual, we are open for suggestions. Just post in this topic or hit us up directly on Discord. Hope to see you there! -- MTA Team1 point
-
1 point
-
use getPedMaxHealth function to find player's max health also use server side to set player's money I'm not sure but it could be like this client: function getPedMaxHealth(ped) -- Output an error and stop executing the function if the argument is not valid assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") -- Grab his player health stat. local stat = getPedStat(ped, 24) -- Do a linear interpolation to get how many health a ped can have. -- Assumes: 100 health = 569 stat, 200 health = 1000 stat. local maxhealth = 100 + (stat - 569) / 4.31 -- Return the max health. Make sure it can't be below 1 return math.max(1, maxhealth) end addEventHandler("onClientClick", root, function(btn, state) if btn == 'left' and state == 'down' then if data.open == true then if isMouseInPosition(screenW * 0.4081, screenH * 0.3932, screenW * 0.1846, screenH * 0.0560) then if (getElementHealth(localPlayer) >= getPedMaxHealth(localPlayer)) then outputChatBox("Your hp is full!") return end if (getPlayerMoney(localPlayer) < 500) then outputChatBox("No money") return else if(getPlayerMoney(localPlayer) > 500 and getElementHealth(localPlayer) < getPedMaxHealth(localPlayer)) then triggerServerEvent("takeMoneyFromPlayer", localPlayer, 500) setElementHealth(localPlayer, getPedMaxHealth(localPlayer)) outputChatBox("Transaction completed") end end end if isMouseInPosition(screenW * 0.6007, screenH * 0.2943, screenW * 0.0176, screenH * 0.0352) then showGUI() end end end server: addEvent("takeMoneyFromPlayer", true) addEventHandler("takeMoneyFromPlayer", root, function(amount) local theAmount = tonumber(amount) takePlayerMoney(source, theAmount) end )1 point
-
fadeCameraDelayed não é uma função nativa do MTA e ela não existe no seu código, por isso está dizendo que esperava uma função no argumento 1 mas obteve nulo, você deve criá-la. Adicione isso no seu script e teste: function fadeCameraDelayed(player) if (isElement(player)) then fadeCamera(player, true, 0.5) end end1 point
-
Hey there, This is just a small showcase of how ATMs function as a part of the economy system, and some highlights of the primary features in the police system; these were created for my roleplay gamemode. I hope you enjoy! ATM System There are two types of ATMs that can be created: ones that support deposits and ones that don't - typically the ATMs that support depositing money are placed near banks. In the video below, you can see an example of withdrawing cash from an ATM, the process of depositing is the same except the animation just plays in reverse. There are also multiple ATM card types with different maximum withdrawal values for how much can be withdrawn from an ATM within the period of 24 hours. The ATM also features security such as automatically intaking the card if there are too many unsuccessful PIN attempts. The 'buttons' on the ATM are actually just dxDrawRectangle's created by the UI system and an event listener is triggered every time one of them is triggered, each button has its own element data so we can determine what key is being pressed. The animation for the money flowing in/out of the ATM is done by having seperate images for the cash flap and the money(the money image is actually always behind the flap out of view ready to come out!) so when we want to play the animation, the position of the flap image is raised using an easing function, and the same with the image of the cash moving down; then we simply listen for a click on the cash image to take it out and close the flap. ELS (Emergency Light System) There are multiple light patterns which exist for different vehicles, ranging from all emergency vehicles and also including others such as the Sultan, FBI Rancher, FBI Truck, etc. All strobe elements can be dynamically placed on vehicles in-game through a strobe editor. ALPR (Automatic License Plate Reader) This has the functionality to automatically search the plates of any vehicle that collides with the scanner hitbox, it automatically takes the vehicle's plates (if the vehicle has plates) and looks it up in the database for any existing flags, warrants, etc. and displays them on the vehicle information prompt, this lookup continues for every vehicle that passes and if a flag is found, the information is locked and retained on the display with an audio cue. There are two radars in the vehicle: one in the front and one in the rear, both can be customized to point to either the opposite lane that the vehicle is travelling on or the same lane. It also functions as a speedometer, any vehicle that drives past has its speed checked, and if the speed of the vehicle passing by is higher than what the 'Fast Limit' is as set by the player, then the violating vehicle's information is also locked and the ALPR operator is notified of the speed the vehicle was in excess of along with the direction they were heading - whilst all of this isn't demonstrated in the video, I might record and display this if there is interest for it. MDC System (Mobile Data Computer) The MDC is a fully responsive web application created with the intention of primarily being used on a web browser, though with Bootstrap it sizes quite nicely after being resized into a browser element placed into a small tablet on the screen, the small tablet version exists to allow quick navigation and usage though there is also a mobile data computer item in-game which can be used to open up a larger functional computer-style view for easier navigation. The web application itself is highly dynamic and created using PHP and Javascipt, most AJAX requests are made on the same page to prevent redirection such that the user can stay on the same page for each section (Civilian, Vehicle, Firearm, Property lookups) and also features a large amount of pop-up modals with a refreshing take on responsiveness.1 point
-
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
-
Forum Rules for Multi Theft Auto: Forums Welcome to Multi Theft Auto: Forums. Please follow these rules to ensure your stay here. TL;DR version Please use common sense and do not do anything which would cause us trouble and we will do our best to not cause you trouble either. Also, be nice. How to contact the Forum Staff MTA Forums are maintained by a team of volunteer administrators and moderators, later referred to as Forum Staff. Please respect their work, as they do it in their spare time and are not getting paid for it. The Forum Staff consists of all active Moderators (section-specific Moderators and forum-wide Moderators) and MTA Team members and is lead by Lead Global Moderators. Their job is to keep these forums in check. You can find the list of Forum Staff members in the Staff section of the Forum. If you need to contact us, you can use following communication channels: Discord (recommended for general questions): Server details | Click to join Forum Messages (PM; recommended for account actions requests and private queries): Staff List Twitter (you can highlight us in your tweets if you would like to receive a reply): @MTAQA Steam Group: Steam Community A. General Forum Rules This is an international forum so all posts should be in English and should also be placed in appropriate sections. Discussions in other languages are allowed, but only within the designated section. By posting to this board, you agree that any content (including code snippets) posted by you will stay visible indefinitely unless decided otherwise by the Forum Staff. Requests for release dates, beta tester positions and demands for information regarding future MTA features may be refused or ignored. Racism, discrimination, bigotry, obscenity and illegal activities are unacceptable in any form, whether it be posts, images or signatures. This includes pornographic and racist images, violent and insulting language of any kind, and posting copyrighted content and warez. Breaking this rule may result in an immediate ban. Do not disclose personal details (eg. names, addresses, telephone numbers, photos) of other users. Do not insult or impersonate other forum members. Do not post religious content on these boards (and on the other services we provide). This is a forum for a multiplayer mod, and not the one to discuss religions. We have no problem with whatever you believe (or whatever you do not believe), just do not drag us into it. Flaming and 'flame wars' will not be tolerated. Ban evasion will not be tolerated either and will be dealt with severely. Backseat moderation² is not allowed. If you see that something should be done about a certain topic, post or user, please report it and leave the decision to the Forum Staff. Do not post anything that is against our EULA. Any advertisement, discussion or sales which appears heavily based on content from existing servers, may be subject to deletion at the discretion of forum staff. Do not post any software that could be used for cheating in MTA gameplay. However, if you have such software in your possession and you would like to share it with MTA Developers, please send it directly to Anti-Cheat Team members via PM (currently ccw & Dutchman). If it is an unknown cheat, we may offer you a compensation for it. Do not advertise non-MTA related products, services and websites on our forums and other pages. MTA-related products, services and websites can be advertised in the following sections: MTA gameservers and communities that you can play on – please use the Servers to play on section hosting companies that can host a MTA server for you – please use the Hosting solutions section paid scripting, mapping, administration, web-design and similar offers – please use the Looking for staff section You can appeal a ban or a decision made by the Forum Staff member – see tips below on how to do it correctly. Insulting a Forum Staff member or getting in an argument with them are not the best ways of doing so. You can expect further actions from us if you do that. B. User Accounts Rules The Forum Staff will never ask you for passwords to your forum account, game server or other services. Quite contrary – we urge you to keep your user account credentials safe, and if possible, to use unique passwords in our forums. If you lost credentials for your old forum account and you can not use the forum’s built-in Password Recovery form, then we can attempt to recover your account manually for you. Please contact us in such a case and make sure to provide us as much information about the account as possible (eg. possible associated e-mail addresses, registration and used IP addresses / ISPs / countries, last activity dates or usage patterns). It is possible to merge two or more accounts into a single forum account, provided that you own all of them. Please contact us and we will do it for you – all of the content will then be moved to that single account. It is possible to rename your forum account, although only once per a while. Please read this topic to find out how to do it and how often it can be changed. Users can own more than one forum account, as long as these accounts are not used for breaking forum rules or other malicious actions (eg. evading a ban, tampering with forum statistics or poll results, disrupting topic discussions). Using multiple forum accounts for posting fake feedback or opinions on servers/server hosters/resources/etc. is strictly forbidden. Similarly, we allow sharing accounts, with the exception of the following cases: Shared account has moderator permissions – sharing such an account is strictly disallowed. One of the users involved in sharing an account is banned. Account is shared with an intention of personal gain by one of the involved users (eg. by tampering with forum statistics). Account is shared with an intention of derailing an existing forum topic by posting off topic comments. Very rarely, we may use special counter-measures against spam bots and ban evaders, such as manual account activation. When this is in effect, new user accounts may not be activated instantly. Please do not create an additional account as it will not be activated faster in such a case, (unless you need an additional account). Instead, please contact us by using any of the communication channels listed at the top of this article and provide your username or e-mail address. Similarly, new and junior Forum accounts must use the Forums for a period of time before being granted all Forum features. These restrictions are to combat spam and abuse. C. Posting Rules and Advice Please use the Forum Search feature to see if your question had been asked before. Additionally, please consult the online documentation if you have problems with the mod or Lua scripting before you post. If you cannot locate your topic or post, please search for it. It could have been moved to another section. If you want to create a topic, please use the sub-forum which suits best for it. You can find the list of sub-forums on the main page of the forum. Make sure to use descriptive titles for your topics. Topic titles which consist just of words such as 'HELP', 'Help me' or 'Please read' are not descriptive at all. Please keep in mind that when you make a post, you may not be able to edit it after 2 hours since it was posted pass. This is done to prevent users from removing the original post content right after they received a satisfactory reply. There are exceptions to this though – see this topic for more details. Please avoid making double posts. Do not post the same topic or content multiple times or re-post it to different sub-forums. It is okay re-post the translation of the content which was originally in English to Other Languages sub-forum as long as this does not violate other rules. Likewise, it is okay to re-post a foreign language topic to main forums, but it needs to be translated to English and posted in the correct section. If there is a topic similar to the one you wish to create, please reply in that topic rather than making a new one. You may bump¹ an old topic if it was created by you, or if the topic is about a problem you are also having. Please do that sparingly though, and only after some time has passed since you have posted. If you intend to bump a support topic then please provide some additional details about the problem in the new post, if available. Please use the [ quote] tag sparingly. Usually there is no need to quote the full message of the original poster, or the message of the poster directly above your post, so please do not do that. If you need to include a source code snippet in your post, always put it inside the [ code] tag. This makes your code easier to read and provides syntax highlighting where applicable, also makes it possible to automatically provide wiki links to MTA scripting functions where needed. Do not reply to spam posts or other posts severely breaking the rules, please report them instead! The reason for this is, that if you reply to a spam bot, your posts will remain even after we delete all posts made by such a bot. Not only this leaves us with more work, but it may also lead to mistakenly flagging your account for removal for posting unwanted content. At the same time, please keep in mind that we will ignore post reports which are related to an argument between some forum users and ask us to support either side. Similar to User Accounts Rules, very rarely we may use special counter-measures against spam bots and ban evaders, which may lead to hiding newly posted content until it is approved by the Forum Staff. In such a case please wait patiently until we approve the post – there is no need to re-post it. D. User Profile Rules Total size of images in your signature must be within either 500x150 OR 720x80 pixels. Anything larger may be removed when noticed. Signatures should use reasonably sized fonts and only a limited number of hyper-links. E. Moderator Decision Appeals Please do not contact several Forum Staff members regarding the same subject. You can contact another Forum Staff member if you do not get a reply to your first message in a timely manner (eg. within 48 hours). Our Moderators are chosen from talented, respectful and active members of our community. We are confident in decisions they make. However, if you are not satisfied with a certain moderator's decision, you can contact them directly about your concerns. Make sure to be polite and explain your point well. If you are still not satisfied with the decision, you can ask a moderator with a higher rank to mediate for you. Just like above, be polite and try to explain your point even better. See Appendix C below for a more extensive explanation of the appeal process. F. Ban appeals Please do not create a new forum account once you get banned from the forum. If you do so, you will be banned again for ban evading and the duration of your original ban will be extended. Instead of evading the ban, you can try appealing it on our Discord’s #support channel. If you were also banned on Discord, please do not try to evade your ban there. Ask someone to contact us for you (or use another communication method as listed at the top of this article). Based on your infractions, we might decide to issue a cooling off period for your ban, during which you should not access the forums. Once it expires and you have followed our suggestions, you can ask us again to remove your ban. If you are looking for an appeal for a ban from a certain MTA server, please contact the server owner of that server. We can not unban you as we have no power over that server. Easiest way to contact the server owner would be to go to that server's website or look for the contact details for that server in Servers to play on sub-forum. G. Section Specific Rules a. General MTA -> Other languages (non-English) section and its sub-forums Basic guidelines. Additional rules may apply, depending on the section. You can only post in these sections if you speak the language which is used in the specific section. Do not post there otherwise. Additionally, English discussions are generally not allowed in those sections. Posting in English in these sections may result in a forum warning. Exceptions apply – if a Moderator starts a topic in such section in English, then other users (only those who speak the language of that section) can post in English in such topic too. Posting in English is also allowed (and preferred) in the General Multi Language discussion sub-forum. Moderation in some sections might be limited if we do not have moderators fluent in such languages. b. MTA:SA -> Support for Client & Server sections Client - How to ask for help in the Client Section Client - Introduction to MTADiag utility c. Community -> Scripting sub-forum Guidelines and formatting tips Additional guidelines d. Community -> Resources sub-forum Community regulations & guidelines Stolen resource accusations are not allowed e. Community -> Other Creations & GTA Modding -> Modelling sub-forum Purpose and usage of this section f. Community -> Competitive gameplay / Gangs sub-forums You may only post in another gang's thread to: ask for a match, arrange time for a match, cancel a match, apply to join, or to offer assistance such as refereeing or providing a server/web space. You may NOT post in another gang's thread for any other reason. Arguments and disagreements should be taken up elsewhere, such as the gang's own forums, for instance. g. Community -> Servers -> Servers to play on sub-forum Only one thread per server is allowed. This makes it easier to find information about a certain server, as it will all be available in a single topic – just make sure to keep it updated. Stolen resource accusations and other causes for fighting are not allowed. Click here for a detailed explanation. In addition to above, we may take extra measures against users who are server owners and are trying to pick a fight in topics of competing server owners. Make sure to report such posts instead of replying to them. h. Community -> Servers -> Looking for staff sub-forum Rules and formatting for this section i. Community -> Servers -> Hosting solutions sub-forum This sub-forum can be used by companies who sell MTA-related hosting services. This also includes web-hosting and virtual/dedicated server hosting, as long as they can be utilized by MTA servers or for hosting them. It can also be used by users to discuss their experiences with a certain host, or who are looking for a server host. We have additional rules in place for entities who would like to offer hosting services to our users. You can find them here. j. Other -> B.L.A.S.T. sub-forum This section is reserved for off-topic fun chat. Blind spamming, however, is not allowed. Posts made in this section do not count for post count or rank improvement. k. Other -> Multi Theft Auto 0.5r2 and Older MTA:VC/GTA3 versions sub-forums These sections are all about our older creations – MTA for GTA3 (also known as GTA3MTA) and for GTA: Vice City (MTA:VC). We no longer maintain these mods, so you may not receive support for them. These mods may also not work on newer PCs at all. You might notice some third party MTA derivatives that are listed in this section, which may or may not be supported by said third parties. While these attempt to recreate the experience of our older creations, they were not made by us so use them at your own risk. l. Other -> Third party GTA mods sub-forum Rules page H. Other Notes If you no longer intend to visit our forums, we can remove your forum account on request. You can ask any Lead Global Moderator for an account removal. See Appendix D for details on how this is done. We are constantly looking for new moderators, especially for the sub-forums in the Other Languages section which do not have any moderators yet. Remember though, you have to be an active forum member with a significant amount of contributions to the forum to even consider applying for the position. What we consider as contributions to the forum: posting useful or original content, providing help to other forum members, reporting troublesome posts and topics and helping us with organizing the forums. What we do not consider as a contribution: having a huge post count gained by posting (at best) normal content or by posting in (at best) regular discussions. Not to even mention gaining it by spammy ways. To apply, please contact a Forum Staff member via a forum PM or ask us on our Discord. However, please keep in mind that by sending your application you agree that it will be shared with other Forum Staff members. This is to ensure that your application is evaluated and handled properly. If you fail to comply with these rules, your post or topic may be immediately deleted from this board without a warning and/or you may face additional consequences depending on the severity of your actions. Thank you for your understanding. -- MTA Team Appendix A – Glossary ¹ Bumping a topic happens when a user posts in a topic solely with an intention of putting it at the top of the list of topics in a sub-forum. ² Backseat moderation is an occurrence when a person who is not a moderator tries to act like one, eg. by posting messages such as 'This topic is dumb and should be locked' or 'This user should be banned' and so on. It is a generally unwelcome behavior on Internet forums. Appendix B – List of possible moderation actions for rule violations A Private Message with a complaint from the Forum Staff member (usually this is the only thing that happens, providing that user is co-operative with us) Forum Warning (expires over time, can be seen in a user's forum profile; having 3 or more warnings at the same time disables user's ability to post) Posting Restrictions (any new posts or topics made by a user may require an approval by a forum moderator) Temporary Forum Ban (user can not access the forums during a specified period; each further ban has a longer duration) Permanent Forum Ban (same as above, except that it does not expire over time; has to be appealed in order to be removed) Global Ban on all of our services (given to extreme cases of rule abusing, using exploits, hack or cheat tools, or posting potentially dangerous resources; generally disallows user from accessing any MTA-related service, including playing the mod itself) Abuse Letter to user's ISP abuse department (last resort if user is still causing us problems) Appendix C – Moderator Decision Appeal process Forum Staff member made a decision which you did not like or think that it might have been biased. You contact this Forum Staff member about it, stating why do you think this decision is wrong and what should be done instead. Forum Staff member adjusts their decision and now both of you are happy about it and no further action is needed. ✓ Alternatively, they sustain or adjust their decision, but you are still not satisfied with it. X You contact a second Forum Staff member with a higher rank than the one who made the initial decision. You explain the situation well and ask this Forum Staff member to review the situation again. Second Forum Staff member evaluates the situation from both yours and original Forum Staff member’s point of views. Once that is done, they give their decision (which is final) as well as an explanation to this decision which should hopefully satisfy all of the parties. Notes: If the original decision is going to be changed, a Lead Global Moderator should be notified about it by the second Forum Staff member before any changes are made. As mentioned above, the appeal should be made to a Forum Staff member with a higher rank than the original one (or another Lead Global Moderator if there are none available). It should not be made to the Forum Staff member with the same rank/level. Appendix D – Forum Account Removal process If you decide that you no longer need your forum account then we can remove it for you. Keep in mind though that we reserve the right to not remove your posts when your account is removed, as they might be still useful for other forum users. Whether your posts will remain or will be removed, will be announced to you by a Forum Staff member who will handle your case. This depends on the amount of the posts on your account and their actual content. If your posts will remain, you will have a choice of them being listed either under your nickname, or under a “Guest” nickname. To remove a forum account: Send a PM on Forums to a Lead Global Moderator (alternatively, you can send it to any Forum Staff member and they will forward it accordingly) asking for an account removal. A Forum Staff member will handle this request and will attempt to verify whether you are the rightful owner of the account. This might be done in various ways and not all of them will require any interaction from your side. Once verified, you will receive a response, giving you terms for removing your account. If you agree to these terms, you will be asked to confirm the removal by sending an e-mail message from the same e-mail address that is associated with the forum account to an address given by the Forum Staff member. Such an e-mail should at least contain the forum username and the account removal request. Once you have sent an e-mail message, you will receive an e-mail message stating that your account will be removed after 14 days, provided that you will no longer access the account during that time. Once you receive this message, you should log out from the account on Forums and no longer try to log in to this account again. Simply log out using the Forum Log Out feature and you are done. After 14 days have passed and the account was not accessed during that time, it will be removed by the Forum Staff member and you will receive an e-mail message, stating that forum account was removed. If the account is accessed any time during the removal period then the process is cancelled.1 point
-
1 point
-
1 point
