
LabiVila
Members-
Posts
272 -
Joined
-
Last visited
Everything posted by LabiVila
-
Yes, almost everyone uses dxDrawText to write texts. As for editboxes, you can either use a real editbox, or draw another rectangle and an editbox upfront it, and set editbox's alpha to 0, that way you can write there. I personally never use progress-bars as some math can solve anything. and destroyElements aren't used for dx things, you have to use removeEventHandler as said above. function destroy () removeEventHandler ("onClientRender", root, draw) end addEventHandler("onClientPlayerVehicleExit",getRootElement(),destroy)
-
https://wiki.multitheftauto.com/wiki/OOP_Introduction it's not all about changing the look, you have to deal with some other stuff then
-
It's compiled... you can't find that script, you can only create one like that
-
You have to manually create it by map editor, otherwise you can't
-
Well it doesn't work like that, https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI function outputing () local money = getPlayerMoney (getLocalPlayer()) local asd = guiCreateLabel (0.25, 0.25, 0.25, 0.25, "CASH: "..money, true) end addEventHandler ("onClientResourceStart", getRootElement(), outputing)
-
Can you show all the script? This has nothing wrong...
-
https://forum.multitheftauto.com/viewtopic.php?f=91&t=27886 try to search sometimes
-
Fully working, thank you so much
-
Thanks but it still does the same... it keeps adding rows in the table, not updating the current one (first one)...
-
local connect = dbConnect ("sqlite", "file.db") function saveP () local x,y,z = getElementPosition (source) local pos = dbQuery (connect, "CREATE TABLE IF NOT EXISTS `position` (`x` float, `y` float, `z` float)") local qres = dbPoll (pos, -1) if (#qres == 0) then local q = dbQuery (connect, "INSERT INTO `position` VALUES (?, ?, ?)", x, y, z) else local qq = dbQuery (connect, "UPDATE `position` SET `x`="..x..", `y`="..y..", `z`="..z) end end addEventHandler ("onPlayerQuit", getRootElement(), saveP) function loadP () local query = dbQuery ( connect, "SELECT * FROM position") local result = dbPoll (query, -1) for i,v in pairs (result) do setElementPosition (source, v.x, v.y, v.z) outputChatBox ("You have been wrapped to your last position.", soure, 255, 255, 255) end end addEventHandler ("onPlayerJoin", getRootElement(), loadP) What's not working? I really am handling this for quite a while but.. it seems cancerious
-
Okay, awesome, thank you so much Really appreciate it
-
It's awesome, thank you so much. I have one more question, how can I check if there's the row added, (row 1) I keep updating that one without adding a row 2 as I don't need that?
-
Working like a charm, thank you very much. By the way, local query = dbQuery ( connect, "SELECT * FROM position") - this gets all columns in the table right? Or what did you exactly do there?
-
local connect = dbConnect ("sqlite", "file.db") function saveP () local x,y,z = getElementPosition (source) local pos = dbExec (connect, "CREATE TABLE IF NOT EXISTS `position` (`x` float, `y` float, `z` float)") if pos then local q = dbQuery (connect, "INSERT INTO `position` VALUES (?, ?, ?)", x, y, z) else local qq = dbExec (connect, "UPDATE `position` SET x = "..x..", y = "..y..", z = "..z) end end addEventHandler ("onPlayerQuit", getRootElement(), saveP) function loadP () local result = dbPoll (dbQuery (connect, "SELECT * FROM `position` WHERE x = "..x.." y = "..y..", z = "..z..")"), -1) if reult then setElementPosition (source, x, y, z) outputChatBox ("SUCCEEED") else outputChatBox ("FAIL") end end addEventHandler ("onPlayerJoin", getRootElement(), loadP) Hey, so I recently got stuck here. What am I doing wrong? is it this line? local result = dbPoll (dbQuery (connect, "SELECT * FROM `position` WHERE x = "..x.." y = "..y..", z = "..z..")"), -1) I just want to save player's last coords when je quits and load when he joins...
-
I think that's done via shadders
-
https://wiki.multitheftauto.com/wiki/IsMouseInPosition It can be done with that... you just have to determine your image's coordinates. (It has a clear example of what you're looking for tho)
-
https://wiki.multitheftauto.com/wiki/Vehicle_Upgrades these may help you
-
Hey guys, I'm about to try and make a script to get top time 1's time and the player who has it. But I have no clue how to start, any advice?
-
Awesome solved it, thanks
-
dxDrawRectangle doesn't have parents or so... instead of: dxDrawRectangle(63, 143, 967, 577, tocolor(9, 9, 9, 216), false, helpwindow) use: dxDrawRectangle(63, 143, 967, 577, tocolor(9, 9, 9, 216))
-
The part where the error is: client: addEventHandler ("onClientGUIClick", sendB, function (selectedName, moneyAmount) local selectedName = guiGridListGetItemText (gridlist, guiGridListGetSelectedItem (gridlist), 1) local yourMoney = getPlayerMoney (localPlayer) if selectedName then local moneyAmount = guiGetText (moneyInput) local moneyAmount = tonumber (moneyAmount) if moneyAmount then if yourMoney > moneyAmount then outputChatBox ("* You have sent "..selectedName.." an amount of "..moneyAmount.."$.", 255, 255, 255, false) takePlayerMoney (moneyAmount) triggerServerEvent ("takingPlayerMoney", getRootElement(), moneyAmount, selectedName) end end end end, false ) server: addEvent ("takingPlayerMoney", true) addEventHandler ("takingPlayerMoney", getRootElement(), function (amount, selectedName) local otherPlayer = getPlayerFromName (selectedName) outputChatBox (amount.." "..otherPlayer) -- I can replace this otherPlayer with selectedName but the purpose isn't really outputhing the name, I'll be giving money to otherPlayer end )
-
You just write this... dxDrawText ("$00000"..getPlayerMoney (local... and if player's money are two numbers like $25 or $26 then you have to get it's length and put some conditions
-
After you trigger the event, you should only do guiSetVisible (panel, false) https://wiki.multitheftauto.com/wiki/GuiSetVisible - it's quite clear tho