Leaderboard
Popular Content
Showing content with the highest reputation on 27/01/22 in all areas
-
You misunderstand how the SQL language works. To get all rows and columns of accounts SQL table, you execute... SELECT * FROM accounts But if you want just id and skin, you execute... SELECT id, skin FROM accounts Thus I recommend you to change the database query to... local skinData = dbQuery(connection,"SELECT skin,id FROM accounts LIMIT 1")2 points
-
Dear MTA forums administration, there appears to be a fair amount of users on our forums that auto-translate all of the content on this web-page. Support topics start with the impression that they are awkwardly-speaking-but-trying English speakers but in replies the quotes turn out to be Spanish, Polish, etc giving away that they actually auto-translate everything. There are people who do not know about this problem because they just set the auto-translator for everything English. Those people suffer from issues of understanding, essentially because the auto-translator botches-up the original writing. I suggest that users should have the ability to decide whether their forums posts should be posted using auto-translation disabled on the HTML elements. This can be done using the HTML translate attribute on div tags. I suggest that there be a new option in the user's preferences to put this attribute on all of their posts by default. Then you should be able to decide on an individual post's basis if auto-translation should be allowed. Please think about the future of our forums. ?1 point
-
1 point
-
Glad to hear that you got it working! You're welcome. Come back if you have any further questions. ?1 point
-
local menu_path = { MENU } local function visit_menu(m) table.insert(menu_path, m) end local function get_current_menu() if (#menu_path == 0) then return false end return menu_path[#menu_path] end local function unvisit_current_menu() table.remove(menu_path) end Look at lua-users wiki: Table Library Tutorial1 point
-
1 point
-
@Cronoss Español : si hay un problema por favor abre un nuevo hilo sin dudarlo,te podemos ayudar. have a nice day.1 point
-
1 point
-
Here: if (result) and (result[1]) then setElementData(source,"id",result[1].id) --I fixed this part setElementModel(source, result[1].skin ) --I fixed this part end1 point
-
Hello @CronossI prepared a code for you according to the text you sent. Español : buen día señor getPedOccupiedVehicle addCommandHandler("motor", function(player,cmd) local acc = player:getAccount() local owner = acc:getName() local vehicle = getPedOccupiedVehicle(player) --typo,i changed this if vehicle then if(getPedOccupiedVehicleSeat(player) ~= 0) then return end if (vehicle:getData("vehicles:owner") == owner) then setPlayerVehicleEngine(player, vehicle) else player:outputChat("No tienes las llaves de este vehículo.", 255, 0, 0) end else player:outputChat("Debes estar en un vehículo para ejecutar este comando.", 255, 0, 0) end end) function setPlayerVehicleEngine(player, vehicle) if (vehicle:getData("vehicles:engine") == 1) then vehicle:setData("vehicles:engine", 0) vehicle:setEngineState(false) player:outputChat("Apagaste el motor.", 214, 37, 37) connection:exec("UPDATE vehicles SET engine=? WHERE id=? AND owner=?", 0, vehicle:getData("vehicles:id"), vehicle:getData("vehicles:owner")) elseif (vehicle:getData("vehicles:engine") == 0) then vehicle:setData("vehicles:engine", 1) vehicle:setEngineState(true) player:outputChat("Encendiste el motor.", 141, 229, 22) connection:exec("UPDATE vehicles SET engine=? WHERE id=? AND owner=?", 1, vehicle:getData("vehicles:id"), vehicle:getData("vehicles:owner")) end end I prefer you to look at my picture I posted here, by clicking the circle button you can place your codes in your comment in Lua assembly1 point
-
Can you show us the text where you used the "id" and "skin" variables, we can help you better.1 point
-
addCommandHandler("motor", function(player,cmd) local acc = player:getAccount() local owner = acc:getName() local vehicle = getPedOccupiedVehicle(player) if vehicle then if(getPedOccupiedVehicleSeat(player) ~= 0) then return end if (vehicle:getData("vehicles:owner") == owner) then setPlayerVehicleEngine(player, vehicle) else player:outputChat("No tienes las llaves de este vehículo.", 255, 0, 0) end else player:outputChat("Debes estar en un vehículo para ejecutar este comando.", 255, 0, 0) end end) can you try this1 point
-
i know someone who is more knowledgeable on this subject @The_GTA ahh he was already here1 point
-
1 point
-
I've moved your topic to the Portuguese sub-forums, please keep in mind that the rest of the forums are English only.1 point
-
no problem if you have any other questions, open a new thread and I will help you as much as I can ?1 point
-
Does your code only take money when entering the marker1? And you want all markers to do the same thing? If yes, take a look at this tutorial: (If that is not the case, please be a bit more specific.)1 point
-
Version 1.4.1(BETA VERSION) - Added coronas and lighting for the objects located in Missionary Hills - Added lighting for a few building objects in Los Santos - Added 2 new settings for settings.lua file * activationMessage (is set to false as default) * activateOnlyAtNight (is set to true as default) More info about the new settings are in settings.lua file Download the new version from here: https://community.multitheftauto.com/?p=resources&s=details&id=18637 Things that will be added in the next version: - Sun lighting - More lighting for buildings that do not have it1 point
-
Glad to be of help. Since you are asking so kindly I want to give you ideas how to continue with your inventory system. I absolutely recommend going with dx because it is more powerful than CEGUI. So these are the functions that should be used: dxDrawImage - drawing inventory icons as well as general GUI images dxDrawText - displaying the item names and descriptions as well as GUI text dxDrawRectangle - styling of the inventory window/grid/whatever bindKey function - opening the inventory with a button onClientRender event - drawing the dx UI each frame onClientClick event - clicking on items in inventory for selection and action onClientMouseMove event - hovering over items to display the description, highlighting, etc triggerServeEvent - asking the server to use an item or update the inventory in some way (throw away item, reordering the inventory, etc) triggerClientEvent - transmitting the inventory to the client Here is how I imagine an inventory to look. Code on requesting the inventory from the server: server.Lua addEvent("onRequestInventory", true); addEventHandler("onRequestInventory", root, function() triggerClientEvent(client, "onClientReceiveInventory", root, player_inventories[client], item_definitions); end ); client.Lua addEvent("onClientReceiveInventory", true); addEventHandler("onClientReceiveInventory", root, function(player_inventory, item_definitions) -- TODO: use the data somehow. end ); local function send_inventory_request() triggerServerEvent("onRequestInventory", root); end Feel free to ask more questions when you have some code done already1 point
-
Hello Dzsozi (h03), your script appears to be missing the path of menus that you are visiting. The path of menus is defined as a list of menu displays d1...dn where d1 is the initially displayed menu, di is the menu that was selected in menu d(i-1). Then switching back to the previous menu is defined as removing the top-most menu entry dn and setting the menu entry d(n-1) as the current menu display. With that idea in your head, I hope that you can figure out it's implementation. Feel free to ask.0 points
