-
Posts
851 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Noki
-
I've found MTA has always been a pillar of stability. What issues of instability did you face, if I may ask?
-
You won't be able to change state to freeze, as freeze is the function's name. You'll need to use a variable that currently isn't in use.
-
I don't see any syntax errors. Make sure that your meta file declares the script is client-side.
-
Whoops, my bad. I forgot this was client side for a second. function advert(_, ...) local localPlayerName = getPlayerName(localPlayer) local msg = table.concat({...}, " ") for _, v in pairs(getElementsByType("player")) do outputChatBox("#FF0000[ADVERT]"..localPlayerName..": "..msg, 255, 255, 255, true) end end addCommandHandler("advert", advert) They're called arguments. Think of it as giving someone instructions. You can tell them to do more specific things by explaining it further. Take the code below: function freeze() setElementFrozen(getPlayerFromName("Noki")) end freeze() Will freeze a player. However, if you want to toggle freeze, you can use an argument to specify. function freeze(state) setElementFrozen(getPlayerFromName("Noki"), state) end freeze(true) freeze(false)
-
function advert(_, msg) local msg = table.concat({..}, " ") local localPlayerName = getPlayerName(localPlayer) outputChatBox("#FF0000[ADVERT]"..localPlayerName..": "..msg, root, 255, 255, 255, true) end addCommandHandler("advert", advert)
-
That's basic debugging. If your argument is nil, then it is not defined. Look through your code to make sure jobList is defined as a grid list.
-
I'm having trouble using OOP to get all elements by type. I: srun "player":getAllByType() O: Error: [string ""player":getAllByType()"]:1: unexpected symbol near '"player"' I: srun ("player"):getAllByType() O: Error: [string "return ("player"):getAllByType()"]:1: attempt to call method 'getAllByType' (a nil value) I: srun Player("Noki"):getAllByType() O: Command results: false [boolean] The last one was kind of a last ditch effort as I'm completely clueless.
-
If you're on Windows, create a shortcut to MTA Server.exe and place it in the startup folder. If you're on Linux, you can make an init script.
-
setAccountData -> dbExec getAccountData -> dbQuery & dbPoll addAccount -> dbExec getAccount -> dbQuery getResourceRootElement(getThisResource()) -> resourceRoot
-
addCommandHandler("vipskin", function(player, _, skin) skin = tonumber(skin) if (not skin or skin == 271 or skin < 0 or skin > 300) then return end -- I think 300 is the highest ID if (not getElementData(player, "vipTime")) then return end setElementModel(player, skin) end )
-
Can you be more specific and maybe even post some code? https://wiki.multitheftauto.com/wiki/OnWeaponFire - Use the wiki
-
Line 42: toggleControl(pla, "vehicle_fire", false) Line 47: Read up on onMarkerHit and its parameters. Maybe you could use onPlayerMarkerHit instead? Line 52: The marker returned false because your arguments are wrong.
-
MTA does control resources used, but only takes action on the intrusive or generally 'naughty' resources. For them to control every resource on every server would be a very big ask and I doubt any of them have the time to do so. The most you can do to combat blatant copied servers is to not play on them. If they have a low playercount, I doubt they will waste their time to renew their hosting. I mean, who wants to pay for a service no one is using? Besides, most people who start these copycat servers are looking for a 'get rich quick' scheme of sorts, where they believe by copying others they will gain popularity. It usually doesn't work. With time, their servers will be empty and eventually close.
-
function refreshGridList() if isElement(newGridlist) then guiGridListClear(newGridlist) for _, player in pairs (getElementsByType ("player")) do local row = guiGridListAddRow(newGridlist) guiGridListSetItemText(newGridlist, row, column, getPlayerName(player), false, false) end end end addEventHandler("onClientPlayerJoin", root, refreshGridList) addEventHandler("onClientPlayerQuit", root, refreshGridList) function createGridList() newGridlist = guiCreateGridList(0.50, 0.50, 0.20, 0.30, true) column = guiGridListAddColumn(newGridlist, "Players", 0.85) if (column) then refreshGridList() end guiGridListSetSortingEnabled(newGridlist, false) end Or, you can add rows when a client joins and remove rows when a client disconnects.
-
l + shadowDist t + shadowDist r + shadowDist b + shadowDist Line 7 of your code is the shadow. Find where l, t, r, b and shadowDist are defined, further up in your code. Line 9 is the text itself.
-
dxDrawText("sample text", 500, 500 + 2, 200, 200 + 2) dxDrawText("sample text", 500 + 2, 500, 200 + 2, 200) dxDrawText("sample text", 500, 500 + 2, 200, 200 + 2) dxDrawText("sample text", 500 + 2, 500, 200 + 2, 200) Offset your text positioning, like the code above.
-
Which graphics card is the best espcially for Grand Theft Au
Noki replied to HarrY_12321's topic in MTA Chat
Higher than 800x600 for sure. You could probably run it on high as well. -
dbQuery does not freeze the server in the way you think it does. It's more so saying that you won't be able to query the database while the result is being fetched. Your server will still work fine. Correct me if I'm wrong. Try it yourself.
-
db = dbConnect(args) function getDataFromDb(id, column) if id and column then qh = dbQuery(db, "SELECT `??` FROM `players` WHERE `id`=?", column, id) return dbPoll(qh, 0) end end Why not use something like that, then loop through the table to get your needed data?
-
function toggleCursor() showCursor(not isCursorShowing()) end No arguments needed.
-
Which graphics card is the best espcially for Grand Theft Au
Noki replied to HarrY_12321's topic in MTA Chat
The 210 is way to old, the same for the 5450. If it's not too much of a hassle, I'd recommend going for the 610 or the 240D. They're much newer than the other ones you mentioned. Any of those cards should run MTA just fine. -
table = {} table[1] = {"foo", "bar"} for i, v in ipairs(table) do for _, y in pairs(v) do print(i.." "..y) end end --[[ i would be the index v would be a table v[1] would be "foo" v[2] would be "bar" y would be "foo"\n "bar" --]] table = {} table[1] = {foo = "xyz", bar = "abc"} for i, v in ipairs(table) do print(i.." "..v.foo.." "..v.bar) end --[[ i would be the index v would be a table v.foo would be "xyz" v.bar would be "abc" --]]