-
Posts
1,141 -
Joined
-
Last visited
-
Days Won
42
Everything posted by Patrick
-
smoothMoveCamera function is not exists in MTA. This is an useful function what you can find on MTA Wiki: https://wiki.multitheftauto.com/wiki/SmoothMoveCamera You have to paste function's source code into your script before use it. And there are 2 other problems in your code: - LocalPlayer is not exists in 2nd line, use localPlayer instead. - local before smoothMoveCamera is incorrect in 3rd line, just remove it.
- 1 reply
-
- 1
-
Wrong section and language, moved to Spanish scripting.
-
-
You have to pass the player's element when you call Portao1() function. And you can use this only on server side, because isObjectInACLGroup is a server sided function. -- SERVER -- example addCommandHandler("opengate", function(player) exports["portaomecanico"]:Portao1(player) end)
-
You can't do it on server side, as far as I know.
-
Hi. You need to cancel the onClientPedDamage event, check the exanple code on wiki.
-
Check this function: https://wiki.multitheftauto.com/wiki/GetPointFromDistanceRotation
-
Hi! getResourceRootElement is not exists (nil), use resourceRoot instead. By the way, getResourceRootElement is an existing function in MTA, you just forgot the () from the end. And I want to ask you to describe in more detail your question next time. Just pasting the error message here is not enough. Thanks.
-
Hi and welcome on the forum. The error message tell you clearly what is the problem. You have to pass a database-connection at first parameter in dbExec, BUT your database-connection is not valid (or doesn't exists). Syntax of dbExec: https://wiki.multitheftauto.com/wiki/DbExec
-
Wrong language, moved to Portuguese section.
-
Wrong language, moved to Portuguese section. And I think this is what are you looking for, onClientClick.
-
Yes, dbFree only needs to be used if a result has not been obtained with dbPoll. Let it be used once in every 30s or more. (but 10s minimum I think)
-
Hi! Looks okay, but you should limit the usage of command, because players can spam it. And the value variable is not defined in 12th line, I think you wanted to use name. No, because dbPoll do it for you. As well dbQuery's callback function would be better like that: And return is unnecessary because you can't return value from callback. (but of course, you can use it to leave from function, if you want) local res = dbPoll(qh, 0) if res and #res == 1 then outputChatBox("Password: "..res[1]["password"], player) else outputChatBox("Not found!", player, 0, 255, 0) end
-
I don't fully understand, but are you looking for a roleplay gamemode? I guess, so I move your thread to Resources section.
-
@djantony Thread moved to Spanish language forum. For any further posting in said language, please use this section. If you want to post in the international section, make sure that the title and post is in English.
-
Hi, .dffc is a custom extension, so we can't tell you how to "unlock" it. Probably "locked" with TEA (Tiny Encryption Algorithm), so you can "unlock" it with decodeString or teaDecode (use 2nd if file's content is base64). Of course, you need to know the key/password.
-
Wrong language, moved to Spanish section.
-
-- LAYOUT local cells = 30 local cells_in_a_row = 6 -- CELL SIZE local cell_size = 30 local cell_gap = 5 -- LEFT-TOP corner position local start_x, start_y = 500, 500 addEventHandler("onClientRender", root, function() -- use loop to draw 30 cells for i = 0, cells-1 do -- calculate cell index in row. ("i % cells_in_a_row" returns a number between 0 and 5) (modulo) local nth_cell = i % cells_in_a_row -- calculate row index local nth_row = math.floor(i / cells_in_a_row) -- cell position local x, y = start_x + (cell_size+cell_gap)*nth_cell, start_y + (cell_size+cell_gap)*nth_row -- draw cell background and text dxDrawRectangle(x, y, cell_size, cell_size) dxDrawText(i, x, y, x+cell_size, y+cell_size, 0xff000000, 1, "default", "center", "center") end end)
-
Wrong language, moved to Portuguese section.
-
With a quick search I found this event onClientVehicleDamage that gives you the attacker's element.
-
Download links are no longer available. I'm going to close this thread, please contact with me @ManuSkrrt if you want to update the links.
-
Wrong language and section, moved to Portuguese section.
-
Here are some excellent resources to learn the basics of Lua scripting: - https://wiki.multitheftauto.com/wiki/Main_Page - https://wiki.multitheftauto.com/wiki/Scripting_Introduction - https://www.lua.org/manual/5.1/ - https://wiki.multitheftauto.com/wiki/Category:Tutorials - https://forum.multitheftauto.com/topic/34453-manuals - https://forum.multitheftauto.com/topic/64228-the-ultimate-lua-tutorial/ - https://forum.multitheftauto.com/topic/121619-lua-for-absolute-beginners - https://forum.multitheftauto.com/topic/95654-tut-debugging/ - https://forum.multitheftauto.com/topic/114541-tut-events/ - https://forum.multitheftauto.com/topic/117472-tut-scaling-dx/ Unfortunately we are unable to teach you everything or tell you how to implement your ideas, but we are able to answer your questions if you ask questions with enough effort.