Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/10/21 in all areas

  1. INTRODUCTION Many of you know MTA:Script Editor and that I've stopped working on it. The main reason was the syntax highlighter has many bugs that annoy me and others. Due to the fact I stopped developing it I decided to find a better solution. At first I wanted to make an extension for Eclipse but I thought that's too much to download for everyone just to script for MTA. Then I wanted to write an extension for Visual Studio but again, too much to download. I heard of Sublime Text which is small in download size but powerful at the same time. So I downloaded it and immediately started researching how to make packages for it. Because I made an application for MTA:SE to fetch all the MTA functions and save them in an SQLite database, I decided to reuse it and generate files for Sublime Text instead. So, this is what I came up with over the weekend. INSTALLATION Make sure you have Sublime Text installed. It works with both, Sublime Text 2 and 3 (thanks Goonz for confirming it works with Sublime Text 2). Download the 50pMTAEditor.zip from the link below. Extract the .zip to C:\Users\\AppData\Roaming\Sublime Text 3\Packages\User\50pMTAEditor\ Run Sublime Text 3 and create a new file (File -> New) - this is only necessary so that you can see if it works Select the syntax highlighter (View -> Syntax -> Lua (MTA:SA) ) Select color scheme which has colors of MTA function names. Red for client-side, Orange for server-side and Blue for shared functions (Preferences -> Color Scheme -> User -> 50pMTAEditor -> Monokai-MTA-Edit) And you're ready to edit .lua files and have all MTA functions highlighted and auto-completion too. DOWNLOAD https://dl.dropboxusercontent.com/u/437 ... Editor.zip (only 512 KB) (MD5: CA7EA2AEE682B79BBCA01A34AC39C9FD) KNOWN ISSUES Auto-complete window that shows up when you're typing function names will show both server and client functions because Sublime Text doesn't know which files should be showing which functions. It doesn't matter for many functions because the parameters are the same, but for some functions it does matter, like outputChatBox has "visibleTo" parameter which is not present in client-side variant. In client-side files you will also see server-side functions (eg. getPlayerAccount).
    1 point
  2. This is an amazing effort done by SKC Vanilla staff, for making an amazing FORMULA 1 type-like event on MTA:SA - here are the video from the official race, they converted maps, they did scripts by their own. As a classic race player i'm proud of what they did. Tell me, if you like that also ;)
    1 point
  3. What you are requesting is known as synchronization, when a client executes a client-side function and you want to share that state across every other player, you must notify the server of the action so that it can tell all players of the change too. This can be achieved with events using triggerServerEvent and triggerClientEvent. For instance, the example below displays how a client executing /trunk will run the function setVehicleDoorState and then share it across to to the server which in turn makes it visible for all other players. Client addCommandHandler("trunk", function() local theVehicle = getPedOccupiedVehicle(localPlayer) if not theVehicle then -- If the player is not in a vehicle. outputChatBox("You must be in a vehicle to toggle the trunk!", 255, 0, 0) return end local newState = (getVehicleDoorState(theVehicle, 1) == 0) and 1 or 0 -- If the trunk is closed, set it to 1 (open) otherwise it must be open, so close it. (state 1) setVehicleDoorState(theVehicle, 1, newState) -- Set the trunk state for this client. triggerServerEvent("syncVehicleTrunkChange", theVehicle, newState) -- Notify the server to set the newState for every player. end) -- This function is called whenever another player toggles a vehicle trunk, it executes the function on this client to update the trunk state -- to the same as what the source player set it to. function updateDoorStateFromOtherPlayer(newState) setVehicleDoorState(source, 1, newState) end addEvent("updateVehicleDoorState", true) addEventHandler("updateVehicleDoorState", root, updateDoorStateFromOtherPlayer) Server function handleVehicleDoorSync(newState) for i, thePlayer in ipairs(getElementsByType("player") do -- For every online player. triggerClientEvent(thePlayer, "updateVehicleDoorState", thePlayer, source, newState) -- Trigger the event to set the vehicle door state to the newState provided. end end addEvent("syncVehicleTrunkChange", true) addEventHandler("syncVehicleTrunkChange", root, handleVehicleDoorSync) Alternatively to save yourself this hassle, if the function is shared as such is the case with setVehicleDoorState, then you can just execute it on the server-side in which case it will automatically be synced to every client.
    1 point
  4. You had a problem in the table. Here's the fix: local Ranks = { {1,400}, {2,200}, {3,100}, {4,80}, {5,50}, {6,30}, {7,20}, {8,20}, {9,20}, {10,10}, {11,10}, {12,10}, {13,10}, {14,10}, {15,10}, {16,5}, {17,5}, {18,5}, {19,5}, {20,5} }
    1 point
  5. So I was inactive for a bit (on and off SAES, player since 2010ish). But today, I was going through my spam folder cleaning it up and somehow a notification for this post was there. WTF! The emails I used for my gta/mtasa needs were from waay back some even inactive etc. Anyway, wanted to login here after years just to say thank you to everyone that contributed. It means a lot to players that grew up playing MTA. The fact that you guys are keeping it updated in 2021 shows just how passionate all of you are in whatever you are doing. keep it up ! just imagine in 50 years mtasa servers still running. this is legendary! - quality
    1 point
  6. We've updated our Account Application system that allows you to register in-game and answer some questions about our rules & roleplay. It should be more accessible and less painful! Stay tuned for the upcoming update
    1 point
×
×
  • Create New...