-
Posts
822 -
Joined
-
Last visited
-
Days Won
86
Everything posted by The_GTA
-
Hello HitmanLM, does my adjustment give you any idea how to continue? Take a look: -- Client-side local img_names = { [1] = "img/gfx/grupo1.png", [2] = "img/gfx/grupo2.png",, [3] = "img/gfx/grupo3.png", [4] = "img/gfx/semgrupo.png" } local function draw_img(x, y, des1, n) dxDrawImage(x*290, y*475, x*150, y*110, img_names[n], 0, 0, 0, tocolor(255, 255, 255, des1), false) end local img_idx = false; addEventHandler("onClientRender", root, function() if (img_idx) then -- TODO: use draw_img to draw the image, with n = img_idx dxDrawText("test: " .. img_idx, 100, 300); end end ); local imagens = { [1] = true, [2] = false, } triggerServerEvent("chamarimagem", hitPlayer, imagens) addEvent("onClientSelectPlayerGroup", true); addEventHandler("onClientSelectPlayerGroup", root, function(idx) if not (source == localPlayer) then return; end; outputChatBox("selected group: " .. idx); img_idx = idx; end ); -- Server-side addEvent("chamarimagem", true) addEventHandler("chamarimagem", root, function (theImages) function chamarimagem() local theGroup if isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo1")) then theGroup = 1 elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo2")) then theGroup = 2 elseif isObjectInACLGroup('user.'..ACL, aclGetGroup("grupo3")) then theGroup = 3 else isObjectInACLGroup('user.'..ACL, aclGetGroup("semgrupo")) then theGroup = 4 end triggerClientEvent(client, "onClientSelectPlayerGroup", client, theGroup); end ) You are using a variable called "ACL" inside of the "chmarimagem" server-side event handler. Please adjust it to a proper value or explain what it is meant to do. Right now it looks like that the variable is not hooked up to any logic. The client-side "onClientRender" event handler has been left for you to complete.
-
I agree with your sentiment! And I like that you are stressing the possibility of "a successor of Multi Theft Auto: San Andreas" as Tut did point out. I hope that the experiences gained in any other MP project get put into perfect shape by the officially MTA-succeeding variant. I don't think MTA will have the first one but probably the best one in the long term.
-
If you don't trigger it from any client-sde, then remove the "true" parameter from the addEvent call for "phoenix". Also, you have not shown me the code location you mentioned. Do you care about doing it?
-
Your "phoenix" event is marked for remote-availability. Do you trigger the event from any client-side aswell?
-
You're welcome! ?
-
-- SERVER local job_registry = {} local function _get_player_jobinfo(player) local info = job_registry[player]; if (info) then return info; end; info = {}; info.current_job = false; job_registry[player] = info; return info; end addEventHandler("onPlayerQuit", root, function() job_registry[source] = nil; end ); function setPlayerJob(player, jobname) local jobinfo = _get_player_jobinfo(player); if (jobinfo.current_job == jobname) then return; end jobinfo.current_job = jobname; outputDebugString("* Set job: " .. getPlayerName(player) .. " -> " .. tostring(jobname)); triggerClientEvent(player, "onClientPlayerSetJob", player, jobname); end -- CLIENT local current_job = false; local pickupMarker = false; local pickupBlip = false; addEvent("onClientPlayerSetJob", true); addEventHandler("onClientPlayerSetJob", root, function(jobname) if not (source == localPlayer) then return; end; if (jobname) then outputChatBox("* Job changed to " .. jobname .. "!"); else outputChatBox("* You are now job-less."); end if (current_job) then if (pickupMarker) then destroyElement(pickupMarker); pickupMarker = false; end if (pickupBlip) then destroyElement(pickupBlip); pickupBlip = false; end end current_job = jobname; if (jobname == "container delivery") then pickupMarker = createMarker( --[[ TODO ]] ); pickupBlip = createBlip( --[[ TODO ]] ); addEventHandler("onClientMarkerHit", pickupMarker, function(hitElement) if not (hitElement == localPlayer) then return; end; -- TODO: do some jobby stuff, synchronize with the server using events. end ); end end ); Hope this helps! Use it as general idea and extend the script. EDIT: fixed a bug in _get_player_jobinfo (21.11.2021 13:14 GMT+1)
-
You have not yet defined the classification of said job. How should the server and client know that a player has the job? You have got two options: use ACL along with internal MTA server accounts use a custom Lua table based job registry After doing the classification, you can spawn markers according to job synchronization data between server and client.
-
What kind of job? Explain the type and the background behind it.
-
The code you posted is supposed to go into sourceS.lua because it does use server-side functions and events (warpPedIntoVehicle and onMarkerHit). Since you are executing warpPedIntoVehicle on players and players are synchronized-with-the-server elements, this function usage is designated for server-side only.
-
The code you posted does originate from sourceS.lua? What exactly should your code do? Provide a brief description of what it should do and the steps that you are doing to test it.
-
What is the debug console output? Could you please either execute the "/debugscript 3" command or look for the debug script log file inside of your MTA server folder? Is your code running serverside or clientside? Please put the contents of your meta.xml file.
-
Hello FR0314, you cannot use client-side-only functions on the server-side. Did you mean to use triggerEvent instead?
-
setFogDistance(getFarClipDistance());
-
Hello csontih, have you tried looking into your scripting debug console? You can open it up by logging in as admin into your MTA server and executing /debugscript 3 Your startJob function is missing an end tag. Try placing one after the call to oututChatBox, like... function startJob() outputChatBox("Teszt Munka", root, 0, 255, 0) end Your call to outputChatBox is missing the visibleTo parameter. I "fixed" it in the above script.
-
Haha, good find with that case player quit case. Else you would definitely get the same invalid element ID problem as for the vehicles in the element data table. I could note that the element data is a heavier system than a simple Lua table. But you have pointed at the right solution to the invalid element ID issue and please mention it the next time or add the code to it right away. I was wondering about this too for a long time. This wouldn't be the first time I criticised MTA for runtime environment design misdecisions. But don't get me started. It kinda just works how it is currently implemented, ignoring the quality of implementation.
-
You took out the call to outputChatBox aswell? My hint was mainly related to that function call as it relates to your inquiry. Thus the dots have to be replaced by the "message" variable too.
-
If you are using a table that is stored inside element data that contains (vehicle) elements then this table is not removed on resource stop BUT the vehicle elements do get destroyed. This will result in a table with invalid element IDs which then get recycled by the runtime to point to different elements. Thus I do not recommend to store such data inside element data but inside a Lua table with player as key instead.
-
You have the option to donate to me. Visit https://osdn.net/projects/magic-txd/ and click on the blue Donation button. I would appreciate it a lot!
-
You forgot to apply the same scheme for calculation as I did the minutes, with the use of modulus operator. Try a % 24.
-
Don't worry. I have analyzed your situation and have come up with a suggested but untested approach. I cannot recommend it out of the box. While some of the steps are sure to work, others depend on tools I have not personally used yet. Please give me your feedback! adjust the config.ini contents by setting lodSupport=false and method=static. This is optimal for editing inside of the MTA map editor. It will generate a map without LOD and have all the models loaded at the moment you execute the "import" command. once you are satisfied with the MTA map result, convert the MTA map back into GTA SA IPL format by using this tool: MTA Club You should then merge the conversion output with your original IPL file, updating the old entries, to make sure that no important world object was lost during the process. feed the final GTA SA IPL files back into scene2res but this time with lodSupport=true and method=stream so that it creates an optimal MTA map for you. Make sure to remove any prior files from the output folder so that your map will only include models, collisions and textures that are actually used by the map. Good luck!
-
Yes. I know that because I am the creator of the tool.
-
OK. Can you show me the config.ini contents?
-
Hello Egor_Varaksa, this sounds like a simple time-distance mathematical problem. You define a point in time where you want to count to and calculate the amount of time until that point. In MTA you have the ability to use the getRealTime function to get the timestamp value which is the seconds count since 1970. You should then add 3600 to timestamp and store this as destination time-point (dtp). Then if you want know how much time is left until the dtp simply subtract the current timestamp values retrieved using a current call to getRealTime from dtp = diff_seconds. diff_seconds = dtp - now diff_minutes = math.floor( diff_seconds / 60 ) % 60 diff_hours = math.floor( diff_seconds / 3600 ) Have fun!
-
I am not sure, buddy. Could you tell me what kind of solution you have used to convert the maps and give the steps for reproduction? You can leave out any map download sources. I am sorry about not responding in the go-for-it way. Some MTA bugs could really ruin my day in this support inquiry.
-
Please remove that image as it contains some of your private details. You might not want people to see it, especially not as public post on imgur! There could be LOD objects attached to regular objects. Have you made sure to remove these aswell? Then you should save your map and try reloading it again. If you want to be really sure then also restart the editor resource or the entire server before reloading the map. Some scripts may create server objects that are not inside the map file.