Jump to content

LabiVila

Members
  • Posts

    272
  • Joined

  • Last visited

Everything posted by LabiVila

  1. If your server isn't based on a map made by map editor, then the 'moving gate' script would work anywhere in your MTA Directory/mods/deathmatch/resources , if you really have no clue where to place that, you have to create a folder, inside the folder move your script and create a meta.xml, there you can add your script. And as for making it passworded, (we) I can't really help you without seeing the script first
  2. function getAll () for i,player in ipairs (getElementsByType ("player")) do local account = getPlayerAccount (player) if account then local name = getAccountName (account) local points = getAccountData (account, "DMpoints") local money = getAccountData (account, "DMmoney") outputChatBox (name.." "..points.." "..money) triggerClientEvent ("info", player, name, points, money) end end end setTimer (getAll, 1000, 0) hey, what's wrong with this trigger? outputchatbox works fine but I am not getting the data client-side... I get: attempt to concatenate local money (a nil value), so it obviously trigger's fault, I'd be glad to know what's wrong tho.. thanks in advance
  3. You need to have quite some big knowledge of how lua works to be able to write your own dx edit boxes, and it has to do with a lot of math. I suggest you to use the link given above, it's one of the bests (if not the best) out there
  4. You complicated it too much, if the points is to give 'thePlayer' 400k then just do this function giveMoney (thePlayer) givePlayerMoney (thePlayer, 400000) outputChatBox ("Ban da lay 400000$", thePlayer) end addCommandHandler ("gmoney", giveMoney) also, you don't need to check 'if player then' as there will surely be the player who wrote the command, but you can check if he is not logged in like that, so you won't give him money, it'll be like: local account = getPlayerAccount (thePlayer) if account and not isGuestAccount (account) then ...
  5. LabiVila

    Vehicle blow

    You can just unbind the keys which it fires, so the rinho won't be able to shot at all
  6. I can't get your sentence at all, you better explain well otherwise I can't help you at all
  7. If you are using guiCreateEdit it means you're using a button too (most likely), if yes then you can try getting it's text by guiGetText and checking if it's not a number then you can continue
  8. Hey, sure databases are very useful, and MySQL is better than Sqlite, even tho I find Sqlite much easier, db.internal shouldn't even be considered if you have a clue about sqlite or mysql. And as for databases, there's quite some stuff you need to read, as always, you should read first: https://wiki.multitheftauto.com/wiki/DbConnect then you can continue in this very well explained toturial: viewtopic.php?f=148&t=38203 there are some even mroe detailed explanations between mysql and sqlite; https://forum.multitheftauto.com/viewtopic.php?f=91&t=61603
  9. Sorry for going off topic @michaleamir but once he understands how it works, then he can easily manipulate with such stuff
  10. First, the second like should be like this: name = getPlayerName (thePlayer) second, rather than exports.mysql:query you can use dbQuery (...) then get the result with dbPoll (thequery, -1)
  11. if getPlayerMoney (source) > 500 then takePlayerMoney (source, 500) else outputChatBox ("No enough money", source) end
  12. Can you post whole client-side script? And whats' debugscript saying?
  13. Second looping isn't needed, it's actually bad; it can be like this: function callAddon ( ) local resources = getResources ( ) for index, resources in ipairs ( resources ) do local resource = getResourceInfo ( resources, "addon" ) if ( resource == "letsdrive" ) then startResource ( resource ) end end end
  14. Just to let you know, if you're doing a race server, the race pickup automatically turns your car as you're actually wanting
  15. Yea did that already, thanks anyway
  16. Working like charm, thank you so much
  17. local theTable = {} function top (who) theTable = who showCursor (true) local main = guiCreateWindow (0.25, 0.15, 0.5, 0.7, "Top points table", true) local mainList = guiCreateGridList (0.04, 0.06, 0.92, 0.94, true, main) local mainListColumn = guiGridListAddColumn (mainList, "Account owner", 0.45) local mainListColumnPoints = guiGridListAddColumn (mainList, "Points", 0.45) if mainListColumn then for i,j in pairs (theTable) do table.sort (theTable, function (a,b) return a[2] > b[2] end) local mainListRow = guiGridListAddRow (mainList) local points = j.pts local name = j.acc guiGridListSetItemText (mainList, mainListRow, mainListColumn, i..". "..j.acc, false, false) guiGridListSetItemText (mainList, mainListRow, mainListColumnPoints, " "..j.pts, false, false) end end end addEvent ("top15pts", true) addEventHandler ("top15pts", getRootElement(), top) Attempt to compare two nil values
  18. Hey, so if I've got something like: mytable = {} table.insert (mytable, {source = player, number = number}) how can I sort the table according to highest number going down? I mean something like doing a top10 or top 15. I tried to loop through it and do the function a > b but didn't result as wished. What can I do?
  19. lol funny how you'd have already been helped if you posted the script rather than your skype
  20. LabiVila

    rectangle

    I'm not sure if that is even possible, but a way I did it once was I just painted a white thing like that, and made it without background, so you can use dxDrawImage and set tocolor ()
  21. LabiVila

    question

    https://community.multitheftauto.com/index.php?p= ... ls&id=6140 check it, it may help you
  22. function kickP (source, cmd, target) local target = getPlayerFromName (target) local you = getPlayerName (source) if target then kickPlayer (target) kickPlayer (source) end end addCommandHandler ("kick", kickP) this should be working fine
×
×
  • Create New...