Jump to content

Bydlo

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Bydlo's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Thanks for the info The reason I was confused is because sometimes you find client functions that sync with server like elements functions: setElementData, getElementsByType etc..
  2. Thanks for the reply. Then why does the function take a parent element at its second parameter if its gonna load the map for all players anyway? So you're suggesting working client side, that's what I thought it would be the best too but will it work though? When I create my loadMapData client version I obviously will need to use the function createObject, will that function create the object then synchronizes it for all players too or only for local player? My question applies for many similar functions like createMarker, createPed, createBlip etc...
  3. I'm trying to create a multi arena lobby server. I know the idea is to assign to each arena a certain dimension then set players to that dimension but that only solves the problem of separating the players in the physical world it doesn't separate the synchronization of players, in other words, if a map started in deathmatch arena ALL players in the server will download that map.. not only those in the arena.. players in dd or shooter for example will unnecessarily download maps from other arenas. Here is my code: function initResource() -- Lobby Arenas.lobby = createElement("Arena", "lobby") Arenas.lobby:setData("dimension", 16) Arenas.lobby:setParent(g_Root) -- Deathmatch arena Arenas.deathmatch = createElement("Arena", "deathmatch") Arenas.deathmatch:setData("dimension", 0) Arenas.deathmatch:setParent(g_Root) loadMaps() end addEventHandler("onResourceStart", g_resRoot, initResource) then when player joins the server he goes automatically to lobby: function onJoin() fadeCamera(source, true) setCameraMatrix(source, unpack(CameraCoordenates)) setElementParent(source, Arenas.lobby) end addEventHandler("onPlayerJoin", g_Root, onJoin) Loading a map. Called from bindKey for debugging purposes. local map = loadMapData(xmlNode, Arenas.deathmatch) So this is the way i tried loading the map I used the server function loadMapData and set its second parameter to the deathmatch arena hoping that the map will only load for childs in the deathmatch arena element but it didn't :/ the way i knew it didn't work is simply by staying at lobby and not joining the deathmatch arena then calling the function with bindkey... the download bar appeared obviously and downloaded about one to two megabytes of data.. So i have some questions: What does the second parameter of loadMapData do? Does createObject() work the same way client side and server side? Or does the object created in client side only appears to local player? How to separate synchronization of players?
×
×
  • Create New...