Jump to content

How does MTA client-resource system working ?


vinigas

Recommended Posts

Hi all,

I'm almost new in MTA server programming (but not n00b in scripting servers like SA-MP :D ) and would like to get more information about MTA client-resource (clientside scripts, images, etc.) system, how does it work :?:

I want create server where if player dont have resources downloaded, he can play deathmatch with over player whose resources also isn't loaded/downloaded. And when all required clientside-data is sended player can spawn in train station and can play normally.

So to do that firstly, I need to know when all required data is sended. :idea: Also I would like to send not all resources for player (for example player dont want some server's carmod textures).

Does MTA have function to control clientside-data/resources ? Does I need to add clientside-events myself ? :roll:

I tried to search info about that for hour, thank for help and sorry for my english... 8)

Link to comment

Hey vinigas,

Here is a quick script guide:

To create a new script simply make a directory (a folder) in your Resources folder I'm going to call mine MyCoolScript

All scripts need a meta.xml file to know where all the files in the script are, also in the meta.xml file you can add lots of other things too.

meta.xml on the wiki: https://wiki.multitheftauto.com/wiki/Meta.xml

So make a file in the MyCoolScript folder called meta.xml and inside it should look like this (basic):

  

In the same directory (MyCoolScript) create 2 scripts, one called myserverscript.lua and myclientscript.lua

Then my myserverscript.lua you can use server functions and events, and in myclientscript.lua you can use client functions and events.

You can communicate between client and server scripts using triggerClientEvent and same to the server script by triggerServerEvent

If you copy the client and server code from here https://wiki.multitheftauto.com/wiki/TriggerClientEvent

and put it in the myserverscript.lua and in the myclientscript.lua that is a basic script made.

Hope this was easy enough to follow and all correct, I would suggest looking around the wiki more it is all there and will help you a lot. Good Luck.

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