Jump to content

About Clientside and Serverside functions/events


GamingTim

Recommended Posts

Posted

Alright so i've created a serverside script which consists of the Admin team and such but i wanted to add a clientside event

What should I do? can i just add the clientside event to the serverside script? or create another script, which is clientside? and if so how can i call the functions(teams) on serverside script? (im planning to use the event onClientPlayerDamage)

350x20_FFFFFF_FFFFFF_000000_000000.png
  • Moderators
Posted

create a new file and use that as a client file.

In the xml you can define what your files are going to be:

https://wiki.multitheftauto.com/wiki/Meta.xml

If you don't define, it will be serverside.

and don't define as shared, because that is only for code which is only useful for utility functions.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Lets say i have created a Team in the serverside script, but there's an event/function that is clientside that i wanted to created and so i created another script ,named it clientside script. how do i link the clientside to the server side?

350x20_FFFFFF_FFFFFF_000000_000000.png
  • Moderators
Posted

Well we are now talking about 2 systems.

A server.

A mta (client).

You can't link them, they are operating apart.

You must keep in mind that a server(serverside) is very far away from you(clientside).

Example: You are in Spain and the server is in Germany.

But you can communicate:

https://wiki.multitheftauto.com/wiki/TriggerServerEvent

https://wiki.multitheftauto.com/wiki/TriggerClientEvent

https://wiki.multitheftauto.com/wiki/SetElementData

Most serverside functions are also sharing information directly.

But if you want to get a serverside team at clientside.

You can use this clientside:

https://wiki.multitheftauto.com/wiki/GetTeamFromName

or trigger it.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...