ok thanks, and when for exemple a type in console : start the event onResourceStart always is triggered before the client side event onClientResourceStart??
hi, i want to know if when a player try to connect to the server, and a resource is already started in server side, he must load the resource before to join, so the event onClientResourceStart on client side is called before onPlayerJoin on server side??
hi, have 2 file : base.lua, eat.lua in the same resource, i want to call a function add_need that is defined in base.lua from eat.lua, but got an error saying that add_need is global variable that has a nil value, mean that the function isn't recognized in eat.lua how can i export it?
hi, i'm a little confused about some function in client side, i can understand that function for making gui is client side, but why a function like setElementHealth or setElementModel is client side, and if for exemple i change the localPlayer model(skin) its seen to the player only or to all other players??
the second biggest problem for these client side function is security, there is a setPlayerMoney in client side, so the client can easly change the amount of money to give to himself
Because of: client crash, connection timed outs, packet loss, server crash, "onResourceStop" and anything else what might make miscommunication.
that what i'm doing right know, i will make server side variable and a timer ( 5 min interval ) to sync data with the client
addEventHandler("onClientRender", root,
function()
if(guiGetVisible(GUITeleporter.window[1]) ) then
local xOff, yOff = guiGetPosition(GUITeleporter.window[1], false)
dxDrawImage(5 + xOff, 225 + yOff, 226, 1, ":teleporter/images/dot_white.png", 0, 0, 0, tocolor(255, 255, 255, 255), true)
end
end
)
you get the x and y position of the parent window and add it as offset
hi, i'm developping a roleplay gamemode, and i wanted to write a player needs system (eating, sleeping, ...)
i can make a timer in server side that decrease there variable for the player, or make the timer in client side that decrease these variable in the client side and before the player disconnect i will send the data to the server. the second aproach is more efficient for the server performance, but its safe? can a player change client side variables?
hello world,
i made i little script that let the player teleport him self wherever he want using x,y,z locations. he can specify interior_id and dimension too but there are optional
to use the script start the resource and press [F10] or type /teleporter to show the main gui
image :
links
github : https://github.com/karimsqualli96/mta_s ... teleporter
pastebin(meta.xml) : http://pastebin.com/WNub0aAy
pastebin(server.lua) : http://pastebin.com/0uYAcjDF
pastebin(client.lua) : http://pastebin.com/aRJqDaAN
community MTA : https://community.multitheftauto.com/index.php?p= ... s&id=10002
hi, i wanted to share database connection info between all my resource, and i found a file setting.xml in the same folder as acl.xml, so i thought its maybe can serve to that prupose, if its the case can you show me some exemple of code, because i don't find any documentation on the wiki
hi, i'm scripting a vehicle system that restrict accessing a vehicle if the player is not the owner of that vehicle,
so first i will load all vehicles from a database and put them into a table(lua table), i want to know if the vehicle element stay alaways the same after calling the function createVehicle , for exemple even if i change its color, or the vehicle explode ect ..
this is essential because i will use the vehicle element as a key of my table