Jump to content

MTA | Write in separate files or in one?


Roderen

Recommended Posts

  • Moderators
44 minutes ago, Roderen said:

Should I write server and client parts in separate files or all in one?

You should only combine them when for example they contain utility functions, like:

https://wiki.multitheftauto.com/wiki/CheckPassiveTimer

When setting the file to shared, it will make a file copy for the server and a copy for every player/client.

<script src="test.lua" type="shared" />

 

 

  • Serverside code runs on the server. > MTA Server.exe
  • Clientside code runs on every player individuality. > MTA San Andreas.exe (There are as much clientsides as there are players > variables are not shared)

Running code on the wrong application, doesn't sounds like a good idea to me.

  • Serverside shouldn't draw UI.
  • Clientside shouldn't kick/ban players. > With other words: A player client(MTA San Andreas.exe) shouldn't be able to ban another player, because the server(MTA Server.exe) is the only application that is able to ban a player.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...