Mersad
Members-
Posts
10 -
Joined
-
Last visited
Details
-
Gang
LFG
-
Location
Mars Planet ;)
-
Occupation
Modeler, Scripter, Image Editor, UI Designer, Founder
-
Interests
=)
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Mersad's Achievements
Square (6/54)
0
Reputation
-
Mersad started following Set Data For Objects In Map File
-
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
-
Mersad started following Expected string at argument 1, got nil , Inferiority of the Highest Ground Point , Need Help with Layering DGS Elements over dxDraw and 1 other
-
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: