Jump to content

Addlibs

Members
  • Posts

    1,060
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by Addlibs

  1. As far as I'm aware, you also need to enable a module through console commands or mtaserver.conf
  2. XML parsing failed, I guess. Look at line 78 text="This is for Biker's only! /> You forgot to end the string. It should look like this text="This is for Biker's only!" />
  3. Is the marker handler server side? I don't think the server is aware of box movement via physics engine.
  4. I guess it's not about ping, but FPS. High quality vehicle mods can drastically reduce FPS on outdated hardware.
  5. local arrow --define it local first, otherwise the variable will be lost as soon as the function is executed and reaches the end of it - it won't be there when you run the function again, thus you wouldn't be able to delete that marker. function arrowFunction ( thePlayer ) --conflict detected. Both the actual arrow and the function were stored under the same variable. local duty = getElementData(thePlayer, "duty") or 0 if duty == 0 then arrow = createMarker ( 0, 0, 0, "arrow", .75, 255, 0, 0, 175 ) attachElements ( arrow, thePlayer, 0, 0, 2 ) else destroyElement ( arrow ) end end addCommandHandler("aduty", arrowFunction)
  6. You would have to import modded DFF and/or TXDs for every vehicle, I believe. However, you can also do it through applying shader to world texture.
  7. function test1(source) local serial = getPlayerSerial(source) local rNode = xmlLoadFile("serials.xml") for i, v in ipairs(xmlNodeGetChildren(rNode)) do --loop through all child nodes (all nodes) local value = xmlNodeGetValue(v) --get the node's value (the text between both markup nodes i.e. Value) if value then --If value found outputChatBox(value, 255, 0, 0, source, true) --output to chatbox. end end end addCommandHandler("test", test1) addEventHandler ( "onPlayerJoin", getRootElement(), test1) Notice: The above code will output all serials from the XML to a player who joins - I do not recommend using it on an open server.
  8. Addlibs

    Help required.

    Fixed BB-Code formatting, so it's easier to see the code. No changes made to it.
  9. I have no idea if it's even possible to stop fire from being created. I'm also not sure if it's entirely possible to prevent fire damage, this code should do well - if not, it will at least protect from flame thrower damage. addEventHandler("onClientPlayerDamage", localPlayer, function(attacker, weapon, bodypart, loss) if weapon == 37 then --assuming that you can use 'Burnt' death cause on onClientPlayerDamage cancelEvent() end end )
  10. Addlibs

    In-build SQL

    MTA's executeSQLQuery uses SQLite, I assume anything possible with SQLite is also possible with executeSQLQuery. However, as far as I know, the only primary key in MTA is predefined, 'rowid'.
  11. Either use a col-sphere in the instead of a marker (using the marker just for the visual aid), or adding a simple 'if' statement: local _, _, height = getElementPosition(hitElement) if height-1 > marker_Z_position and height+1 < marker_Z_position then --Do your stuff end
  12. > >41EF67910EADFD0C8F6528FFDA695DA3>>
  13. I know what a 'while' statement does, but I don't understand your usage of it. Could you add some comments within the code?
  14. You forgot to end the 'if' statement initialised on line 5.
  15. What you want to do to keep MTA server running through SSH is setting up a GNU Screen (type 'screen'), start MTA server, press Ctrl+A and straight away press D, then logout from SSH as usual and the server will keep running. To return to the screen, simply type 'screen -r'.
  16. and loads slightly faster, since Lua can only be loaded in bytecode form (compiled); meaning that MTA compiles a Lua code before executing it; thus increasing loading time. Pre-compiled files load slightly (almost unnoticeable, unless using very large files) faster.
  17. I mean, give more comments about what the 'while' statements do - I keep getting lost in that script, sorry.
  18. width = actualWidth - ( actualWidth * (distance/maxDistance) ) height = actualHeight - ( actualHeight * (distance/maxDistance) )
  19. If I had a more time, I could check the code but unfortunately. I'm gonna rely on someone else to help from here.
  20. but as I said, it's not 'exactly' the same. This new one should have a line number included, prefix ERROR: dxscoreboard_client.lua:
  21. Change the meta to use the uncompiled (just for now, you can change it back later), restart scoreboard, restart your script, look for that error again - this time it will include the line at which the error occurred.
  22. Do you have an uncompiled version of server/mods/deathmatch/resources/[gameplay]/scoreboard/dxscreboard_client.lua?
  23. if source == BuyButton then if guiGridListGetRowCount(Cartlist) > 0 then local count = 0 while count <= guiGridListGetRowCount(Cartlist) do local count = count + 1 for count,price in pairs(pricetable) do local totalprice = totalprice + price if count == guiGridListGetRowCount(Cartlist) then if getPlayerMoney(localPlayer) >= totalprice then while count <= guiGridListGetRowCount(Cartlist) do for count,id in pairs(weapontable) do for count,ammo in pairs(ammotable) do triggerServerEvent(localPlayer,"giveweapon",resourceRoot,localPlayer,id,ammo) end end end takePlayerMoney(localPlayer,totalprice) else outputChatBox("You don't have enough money!",localPlayer,255,0,0) end end end end takePlayerMoney(buyer,totalprice) else outputChatBox("You don't have anything in your cart!",255,0,0) end end Could you explain what you were trying to achieve with this? I find it hard to find my way in this script.
  24. You can store a Lua table inside a database column using JSON (toJSON, fromJSON), if that's what you mean.
  25. You should let us get more information. Are you using the default (without any changes at all) scoreboard? If so, please take a screenshot of the error whilst using an uncompiled version (if possible) so we can find out which line is causing the error.
×
×
  • Create New...