Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/10/24 in all areas

  1. The shared side is a way to share variables and functions between the client and server in the MTA. However, it is important to understand how it works to avoid errors and unexpected behavior. When you define a variable on the shared side, it is shared between the client and the server. However, the variable is not automatically synchronized between the two. This means that if you change the variable on the server, it will not automatically be updated on the client, and vice versa. To synchronize shared variables, you need to use a synchronization mechanism, such as an event handler or a command. This is necessary because the MTA does not automatically synchronize shared variables between the client and the server. In your example, you defined the SCRIPT_activity and SCRIPT_text variables on the shared side and tried to access them on the server without using an event handler or command. This did not work because the variables were not synchronized between the client and the server. When you used an event handler (onResourceStart) or a command (writeText), you synchronized the shared variables between the client and the server. This allowed the variables to be accessed correctly on the server.
    2 points
  2. Thank you. I tried creating two server side lua file (I put a variable in first server.lua file, I tried to use it in second file like I tried to use variable without synchronizing in shared side file) and I had to synchronize it in server side too. So, I understood that I have to synchronize variables to use between other script files. But, can you tell me all synchronizing methods? Event Handlers, Commands, and what else? Yes, thank you. Even I tried to use it in shared side: -- shared outputChatBox("Hello MTA World!") And that has been sent to chatbox twice. Because it worked in server and client side, right?
    1 point
  3. Fade2Black Survival & DayZ v1.2 We offer you new updates of our server, as Fade2Black Development Team, we continue our developments, we are making an effort to make innovations every month, do not forget them and you should know that this project is a completely volunteer-based project. ** Chat Update** > - the chat delay and message deletion dela has been fixed, if you encounter a problem again, please create a ticket again by suggestions > - chat has a limited message reading history, to overcome this, open chat and you will be able to read some past messages, when chat is closed this limit is limited to only 5 > - Added the ability to scroll chat messages page up and page down. It also resets the scroll when the chat is closed. If you do not scroll back, you will not see new messages > - Added the ability to close the chat with Esc **Scoreboard Update** > - Titles will be given according to ranks, and in the future, in v1.3, you will have titles up to the number of zombies you kill > - flags and flag names will now be visible, pngs of country flags and names will be visible on the scoreboard. **Shader Update** > - the shader vignette issue has been fixed, now you can stick more opacity settings and see the surroundings more transparently. > - shader will look a little more effective on mask and mask type items **Zombies Update** > - the walking and running animations of zombies have been fixed, now you will be able to run away from zombies a little more. **Information UI Update** > - the design of the panel where players can get information has been completely changed, we now have a theme like in DayZ Standalone **The Ghost Valley** > - [Fade2Black Development Team] Discord : https://discord.gg/fade2black Server Address : mtasa://91.134.166.76:22013
    1 point
  4. Additional context: Serverside is code executed on the server. The application all players are connected to. Clientside is code executed on each client/player his game. There are as many clientsides as there are players in the server. They all run a copy of all clientside scripts. Each player downloads the clientside code from the server. When a player joins the server, in most cases the copy of the code will only run until the download is finished. (with an exception if priority is given to a specific resource) Shared is code executed On the server And a copy of the code is executed on each client / player his game Nothing is shared between them, except for running the same copy of the code.
    1 point
×
×
  • Create New...