-
Posts
18 -
Joined
-
Last visited
Everything posted by Mersad
-
I can't find such a file. It seems like this class doesn't even exist in the source code.
-
I am working on a launcher based on the MTA source code and I want to exclusively support the fastman92 limit adjuster. Naturally, MTA blocks ASI Loaders, making this impossible. Which specific part of the source code should I modify to disable this block? ( I want to create a whitelist for some ASI files. )
-
Hello! I'm currently developing a custom client for my server using the MTA Git source code. I need to add a new map alongside the game's original map. I have an IMG file along with some IDE and IPL files for it. Additionally, I want the server to run as optimally as possible. Is there a way to execute these files efficiently? For example, executing them within the main game before the launcher starts (something like adding files to gta.dat), or any other optimized method? Thanks!
-
Well, I was considering using such an approach, but the wiki states the following about this function: "Note: Calls may incur a performance overhead - they are not equivalent in performance to calling functions in the same resource." I felt that this might cause delays on the server. Does this delay have any significant impact?
-
No, I want to use the system I wrote instead of the regular outputChatBox in each individual source. I have already written the color change system, but my problem is that I don't know how to use it in all sources without causing delays. The event system was the only solution I could think of, but I'm not sure if this system will cause lag or delay.
-
I want to send texts with specific keywords to maintain a consistent color palette for outputs. For example: "Hello&redWorld" In our handler function, we replace the &red with #ff0000 to change the color of the rest of the chat to red. I have done this for many colors and want to use constant values to make the code more stable and dynamic. If I were to use classic color placement (outputChatBox), it would be difficult, and editing the code would be harder. Is there a better way to achieve this? Additionally, if not, if I implement this with events, could it slow down or lag my server? What steps should I take to prevent this issue? I can put the color change code in each individual source and be sure that my code will not cause lag or delay, but this is not a proper approach. Additionally, if I later need to edit the hex code of a color, I would have to make this change in each individual source, which is hard and cumbersome. @TMTMTL & @IIYAMA
-
Hello everyone! I'm developing a server and recently started managing all server outputs through events. For example, instead of directly calling `outputChatBox`, I've defined an event `onRequestChat` and then call `outputChatBox` within that event. My question is whether this approach can significantly impact server performance, especially when there are many players. Is it possible that extensive use of events could cause the server to slow down or lag? Thank you!
-
Hello! Is it possible to include additional information in the chatbox when completing a name with the tab key? For example, let's say we have the following data for each player: getElementData(player, "inGameID"); We want to achieve something where when a player brings up the chatbox and writes part of another player's name, after completing the name with the tab key, the ID is appended to the name. For instance, if a player's name is "Rage" and we write "Rag" and then press the tab key, the name is completed to "Rage". We would like the player's ID to appear after their name, like "Rage [1]". I have found several servers that have this feature and they don't use setPlayerName for it because there is a space between the name and the ID.
-
Hello! Can we assign specific data for each object in a map file? For example, let's say we assign a int data named "heal" for each object, and in a Lua Script file, within a loop for all the resource objects, we assign the value of object heal to the designated data in the file. <object model="" posX="" posY="" posZ="" rotX="" rotY="" rotZ="" interior="" dimension="" scale="" collisions="" alpha="" frozen="" heal="" /> --or other syntaxes
-
Hello Everyone! I have the following code: local thePlayer = localPlayer local x, y, z = getElementPosition(thePlayer) local rot = getPedRotation(thePlayer) local newX, newY = getPointFromDistanceRotation(x, y, 3, rot+180) So, this code calculates the coordinates (x and y) 3 meters in front of the player's position. Now, I want to check if the highest point at these coordinates is water (true) or not (false). This is to ensure that the action is only performed if there is water in front of the player. How can I achieve this?
-
Thank you so much! That solved my problem. The reason I’m not using dgsCreateImage is that I want to create smooth and fluid animations for my background images to make them more visually appealing. As far as I know, this isn’t possible using GUI or DGS elements. Is that correct?
-
Hello everyone! I hope you’re all doing well. I’m currently working on a panel using dxDraw and DGS. I’m using dxDraw for background images and other elements, and DGS for edit boxes and similar components. I’ve run into a bit of a snag, though. The DGS elements are appearing behind the dxDraw element that I’m using as a background. Since these are edit boxes, they should be appearing on top of the background. I’ve been scratching my head over this for a while now, and any help or guidance would be greatly appreciated. Thanks in advance for your time! Best regards.
-
Wow??
- 32 replies
-
- mtasa
- mtasa 1.6.x
-
(and 3 more)
Tagged with:
-
Thanks Bro! It Works
-
Hello @mafioz Thanks for the reply , but it doesn't work.
-
Hello! Do you know what the problem is? --Server Side function VoteSystem(title) outputChatBox("Ghor'e Keshi Shodu Shod! Ba Dasture [/sherkat] Dar Ghore Keshi Sherkat Konid!") end addEvent("ElameShorueGhore", true) addEventHandler("ElameShorueGhore", resourceRoot, VoteSystem) function getrp( source, commandName ) randomP = getRandomPlayer() triggerClientEvent(source, "getRandPlayer", source, randomP) end addEvent("StartRandom", true) addEventHandler("StartRandom", resourceRoot, getrp) --Client Side (Summarized) function dxUI(randomP) ui["BG"] = dxDrawImage(x*741,0,x*619,y*487,"files/BG.png") ui["title"] = dxDrawText(title, 0, y*70, x*1340, 0, tocolor(255, 255, 255, 255), 1, titleFont, "right") ui["playerWon"] = dxDrawText(tostring(getPlayerName(randomP)), x*860, y*242,0,0, tocolor(255, 255, 255, 255), 1, playerFont) end addEvent("getRandPlayer", true) addEventHandler("getRandPlayer", root, dxUI) function ghore(CMD, ...) if (ghoreStatus == 0) then ghoreStatus = 1 local EnteredTitle = table.concat ( { ... }," " ) title = tostring(EnteredTitle) addEventHandler("onClientRender", getRootElement(), dxUI) triggerServerEvent("ElameShorueGhore", root) triggerServerEvent("StartRandom", root) end end addCommandHandler("ghore", ghore) I keep getting this warning in debugscript: Warning: ghore\server.lua:10: Bad argument @'triggerClientEvent' [Expected string at argument 1, got nil] Warning: ghore\client.lua:19: Bad argument @'getPlayerName' [Expected player at argument 1, got nil] Warning: ghore\client.lua:19: Bad argument @'getPlayerName' [Expected player at argument 1, got nil] [DUP x214] Warning: ghore\client.lua:19: Bad argument @'getPlayerName' [Expected player at argument 1, got nil] [DUP x215]
-
It Works To Some Extent! I made the previous code more complete and still dxDrawText placed under guiCreateStaticImage! Server: function VoteSystem(title) outputChatBox ("Your Vote Title: " .. title, client) end addEvent("VoteConnection", true) addEventHandler("VoteConnection", resourceRoot, VoteSystem) Client: sx, sy = guiGetScreenSize() ClientGUI = {} VoteStatus = false function votepanel() VoteStatus = true ClientGUI[3] = guiCreateStaticImage(0, 0, sx, sy, "/files/BG.png", false) ClientGUI[4] = guiCreateStaticImage(sx*0.85, sy*0.08, sx*0.1, sy*0.1, "/files/exit.png", false) ClientGUI[5] = guiCreateStaticImage(sx*0.3, sy*0.3, sx*0.4, sy*0.09, "/files/yes.png", false) ClientGUI[6] = guiCreateStaticImage(sx*0.3, sy*0.41, sx*0.4, sy*0.09, "/files/no.png", false) showCursor(true) end addCommandHandler("ray", function() votepanel() end) function HideVotePanel() for i, v in pairs(ClientGUI) do if (v) then destroyElement(v) end end VoteStatus = false showCursor(false) end addEventHandler("onClientGUIClick", root, function() if (VoteStatus) then if (source == ClientGUI[4]) then HideVotePanel() end end end) function VoteCommand (commandName, ...) local title = table.concat ( { ... }," " ) TextDraw = tostring(title) triggerServerEvent ( "VoteConnection", resourceRoot, tostring(title) ) addEventHandler("onClientRender",root,render) outputChatBox(title) end addCommandHandler ( "vote", VoteCommand ) function render() ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2) end Many Thanks!
- 4 replies
-
- nil
- dxdrawtext
-
(and 1 more)
Tagged with:
-
Hello! I ran into some problems while coding: Server: function VoteSystem(title) outputChatBox ("Your Vote Title: " .. title, client) end addEvent("VoteConnection", true) addEventHandler("VoteConnection", resourceRoot, VoteSystem) Client: sx, sy = guiGetScreenSize() ClientGUI = {} function VoteCommand (commandName, ...) local title = table.concat ( { ... }," " ) TextDraw = tostring(title) triggerServerEvent ( "VoteConnection", resourceRoot, tostring(title) ) outputChatBox(title) end addCommandHandler ( "vote", VoteCommand ) --ClientGUI[3] = guiCreateStaticImage( sx*0.03, sy*0.03, sx*0.5, sy*0.5, "/files/BG.png", false ) guiMoveToBack(ClientGUI[3]) addEventHandler("onClientRender", root, function() ClientGUI[2] = dxDrawRectangle(sx*0.2, sy*0.3, sx*0.6, sy*0.5, tocolor(0,0,0,150)) ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2) end) After running the code and entering /debugscript 3, the following error appears: WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x213] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x214] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x215] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x213] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x212] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x79] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x71] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] [DUP x87] WARNING: vote\votes_c.lua:17: Bad argument @'dxDrawText' [Expected string at argument 1, got nil] But the code works and by writing /vote [text], the text [text] is entered into dxDrawText How do I fix the error? The second problem: In the client file: sx, sy = guiGetScreenSize() ClientGUI = {} --General function VoteCommand (commandName, ...) local title = table.concat ( { ... }," " ) TextDraw = tostring(title) triggerServerEvent ( "VoteConnection", resourceRoot, tostring(title) ) outputChatBox(title) end addCommandHandler ( "vote", VoteCommand ) ClientGUI[3] = guiCreateStaticImage( sx*0.03, sy*0.03, sx*0.5, sy*0.5, "/files/BG.png", false ) -- Image Background guiMoveToBack(ClientGUI[3]) addEventHandler("onClientRender", root, function() ClientGUI[2] = dxDrawRectangle(sx*0.2, sy*0.3, sx*0.6, sy*0.5, tocolor(0,0,0,150)) ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2) -- Title end) --General ENDho How do I put " ClientGUI[3] = guiCreateStaticImage( sx*0.03, sy*0.03, sx*0.5, sy*0.5, "/files/BG.png", false )" under "ClientGUI[1] = dxDrawText(TextDraw, sx*0.21, sy*0.31, sx, sy, tocolor(255,0,0,255), 2)" ?
- 4 replies
-
- nil
- dxdrawtext
-
(and 1 more)
Tagged with: