![](https://forum.multitheftauto.com/uploads/set_resources_22/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
myonlake
Members-
Posts
2,312 -
Joined
-
Days Won
41
Everything posted by myonlake
-
Let me quote from the Wiki page that you said you read. @Wassim: If he has a GUI window with 1900x1200 as its resolution and someone with 800x600 joins the game, he's unable to see half of the whole GUI window. What I propose is use relative positioning and scaling so none of this is an issue.
-
https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI
-
Use relative positioning to fix this issue.
-
Setting element data for something like this is stupid and inefficient. Just check which slots are in use and don't allow changing if they have five slots in use.
-
In addition to that it's worth the price. These indeed look very unique and very special work, I'd pay for it if I was in need of good maps like these.
-
Make sure it's client-side.
-
DDoS protection is the best joke I've heard. Learn networking and you don't need to spend more than 15 dollars to stay up a year. Additionally, there are no serious roleplayers here any longer. I doubt it's a good idea to spend time on a server. A decade of experience is just the proof you need. Decade is a lot of time, and now times have changed.
-
He knew it was wrong. And regardless, he wasn't the only one creating it. There was Chamberlain, mabako, Herbjr, Serizzim, Konstantine, Hankey, Cazomino, Flobu, CC and Mount. It would've not only been his decision because they were doing it as a team and I am sure he did it to backstab people. Obviously he was the owner, but morally it's still wrong to do this type of thing without having a discussion about it with the whole team.
-
If you made a paynspray script you'd know how to make customers pay too. However, use the takePlayerMoney function.
-
Indeed. But he passed ownership to a co-scripter, which then led the project from that on. Daniels leaked the code after that, which is not only backstabbing but also morally wrong.
-
Regardless of how happy the people are and how happy the past contributors are, it's still morally wrong, unless of course the past owners wanted it to be released, which they did not.
-
With shaders you can change the texture of a blip.
-
In addition to that I've tested the script and it works just fine. If you have the right code then it should work for you as well.
-
[OK] MySQL on Debian 6 (64bits) and MTA Lua Script
myonlake replied to =KoG=Rouche's topic in Scripting
Or then you can make your own wrapper functions on top of default database functions and then extend the abilities of the default functions so that they're close to the module's functions and features. -
addCommandHandler("pm", function(thePlayer, commandName, sendTo, ...) local pmMessage = table.concat({...}, " ") if (not sendTo) or (not ...) or (not pmMessage) or (#pmMessage == 0) then outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /" .. commandName .. " [partial player name] [message]", thePlayer, 255, 255, 255, true) return end local target if (tonumber(sendTo)) then target = exports.ID_System:getPlayerFromID(tonumber(sendTo)) else target = getPlayerFromPartialName(sendTo, thePlayer) end if (target) then if (target == thePlayer) then outputChatBox("#0044FF[PM]#FFFFFF Message to #FFFFFF" .. getPlayerName(target) .. "#FFFFFF: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#0044FF[PM]#FFFFFF Message from #FFFFFF" .. getPlayerName(thePlayer) .. "#FFFFFF: " .. pmMessage, target, 255, 255, 255, true) else outputChatBox("#0044FF[PM]#FFFFFF You cannot PM yourself#FFFFFF!", thePlayer, 255, 255, 255, true) end else outputChatBox("#0044FF[PM]#FFFFFF Player not found! #FFFF00(#FFFFFF" .. sendTo .. "#FFFF00)", thePlayer, 255, 255, 255, true) end end, false, false ) function getPlayerFromPartialName(name, sourcePlayer) if (not name or type(name) ~= "string") then return end if (sourcePlayer) then if (name == "*") or (string.gsub(getPlayerName(sourcePlayer), "#%x%x%x%x%x%x", ""):lower() == name:lower()) then return sourcePlayer end end local match = {} for _,player in ipairs(getElementsByType("player")) do local matchName = string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "") if (string.find(matchName:lower(), name:lower(), 0)) then table.insert(match, player) end return (#match > 1 and false or match[1]) end end
-
Line no. 14, fix it. Undo line no. 31.
-
It's not hard to switch a non-equal operator to equal... I am certainly not going to do that for you since you can just do it yourself. Copy the code again, by the way.
-
Try the following. Server-side addCommandHandler("pm", function(thePlayer, commandName, sendTo, ...) local pmMessage = table.concat({...}, " ") if (not sendTo) or (not ...) or (not pmMessage) or (#pmMessage == 0) then outputChatBox("#0044FF[PM]#FFFFFF Invalid syntax! Usage:#FFFFFF /" .. commandName .. " [partial player name] [message]", thePlayer, 255, 255, 255, true) return end local target if (tonumber(sendTo)) then target = exports.ID_System:getPlayerFromID(tonumber(sendTo)) else target = getPlayerFromPartialName(sendTo, thePlayer) end if (target) then if (target == thePlayer) then outputChatBox("#0044FF[PM]#FFFFFF Message to #FFFFFF" .. getPlayerName(target) .. "#FFFFFF: " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#0044FF[PM]#FFFFFF Message from #FFFFFF" .. getPlayerName(thePlayer) .. "#FFFFFF: " .. pmMessage, target, 255, 255, 255, true) else outputChatBox("#0044FF[PM]#FFFFFF You cannot PM yourself#FFFFFF!", thePlayer, 255, 255, 255, true) end else outputChatBox("#0044FF[PM]#FFFFFF Player not found! #FFFF00(#FFFFFF" .. sendTo .. "#FFFF00)", thePlayer, 255, 255, 255, true) end end, false, false ) function getPlayerFromPartialName(name, sourcePlayer) if (not name or type(name) ~= "string") then return end if (sourcePlayer) then if (name == "*") or (string.gsub(getPlayerName(sourcePlayer), "#%x%x%x%x%x%x", ""):lower() == name:lower()) then return sourcePlayer end end local match = {} for _,player in ipairs(getElementsByType("player")) do local matchName = string.gsub(getPlayerName(player), "#%x%x%x%x%x%x", "") if (string.find(matchName:lower(), name:lower(), 0)) then table.insert(match, player) end return (#match > 1 and false or match[1]) end end
-
This is a good example on how to make it work regardless of where you click on your screen. local updateLabel, updateGridlist -- initialize two nil timers local label = guiCreateLabel(500, 100, 100, 50, "nil: nil", false) -- create a gui label at 500,100 local gridlist = guiCreateGridList(600, 100, 170, 180, false) -- create a gui gridlist at 600,100 guiGridListAddColumn(gridlist, "vehicle name", 0.7) -- add a column to the gridlist guiGridListAddColumn(gridlist, "r", 0.2) -- and another column for i,v in ipairs(getElementsByType("vehicle")) do -- loop through all vehicles on the server if (i > 10) then break end -- break at ten local row = guiGridListAddRow(gridlist) -- add a new row to the gridlist guiGridListSetItemText(gridlist, row, 1, getVehicleName(v), false, false) -- give the name column a value guiGridListSetItemText(gridlist, row, 2, math.random(100,999), false, false) -- and the r column as well end updateGridlist = setTimer(function() -- execute a new timer to update the r columns if (isElement(gridlist)) then killTimer(updateGridlist) return end -- if the gridlist is no longer, kill the timer for i=0,guiGridListGetRowCount(gridlist) do -- loop through all rows guiGridListSetItemText(gridlist, i, 2, math.random(100,999), false, false) -- update the gridlist column with a new random value end end, 1000, 0) -- do the function each 1000ms addEventHandler("onClientGUIClick", gridlist, -- when the gridlist is clicked on, do the function function() local row, col = guiGridListGetSelectedItem(gridlist) -- get the currently selected row and column if (isTimer(updateLabel)) then killTimer(updateLabel) end -- if the timer exists, kill the timer if (row ~= -1) and (col ~= -1) then -- if they clicked some row local text1 = guiGridListGetItemText(gridlist, row, 1) -- get the name column value local text2 = guiGridListGetItemText(gridlist, row, 2) -- and the r column guiSetText(label, text1 .. ": " .. text2) -- update the current values updateLabel = setTimer(function(row) -- execute a new timer to update them constantly if (isElement(gridlist)) then killTimer(updateLabel) return end -- if the gridlist is no longer, kill the timer local text1 = guiGridListGetItemText(gridlist, row, 1) -- get the name column value again local text2 = guiGridListGetItemText(gridlist, row, 2) -- and the r column value as well guiSetText(label, text1 .. ": " .. text2) -- and then update the label end, 1000, 0, row) -- do the function each 1000ms for the corresponding row end end )
-
You have to kill the timer with killTimer.
-
You can use the setTimer for example. Not the best choice but there aren't many other anyways. If it's a temporary label, then it should be good. I suggest looking at text items as well.
-
If it's doing nothing, then you've never started the resource or you have the wrong script in there. Have you re-copied and pasted the code?
-
You could only steal your own password there, lol. The only problem with using client-side XML is that it can be faked very easily. I could just pass in someone else's username and hash if I ever got a hand on them, or whatever else is stored there.
-
The client functions as you explained only work server-side. Also, it's more practical to use takePlayerMoney and givePlayerMoney instead of setPlayerMoney.
-
That's quite weird because I am logged in within the Admin ACL group and it works just fine. Re-copy the code and try again. http://puu.sh/5xBOh.png