Jump to content

Drakath

Members
  • Posts

    768
  • Joined

  • Last visited

Everything posted by Drakath

  1. Return a list of players that are in a vehicle you specify. getPlayersInVehicle(vehicle)
  2. Drakath

    Get players

    Is there a function to return a list of players who are in a vehicle you have specified?
  3. Drakath

    tables

    Should I use table.remove to do that?
  4. Drakath

    tables

    Alright, last question. If I use table.insert to upgrade wheels and then upgrade the wheels again but with a different upgrade, will it replace the old one or will they both stay? If they will both stay then how can I remove a particular upgrade?
  5. Drakath

    tables

    So how do I set nitro for that data?
  6. Drakath

    tables

    ****** This is how I got my data: *****
  7. Drakath

    tables

    Well, I got this error: bad argument #1 to 'ipairs' (table expected, got string)
  8. Drakath

    tables

    I'm not sure how does this JSON thing works. Would it work like that: local json = toJSON ( { getAccountData (getPlayerAccount(source), "cu") } ) ?
  9. Drakath

    tables

    function yo () local u = nil local u = {} local u = getAccountData (getPlayerAccount(source), "cu") for i,v in ipairs (u) do addVehicleUpgrade (vehicle, v) end end addCommandHandler("upgrade", yo) ERROR: script\server.lua:5: bad argument #1 to 'ipairs' (table expected, got number) How can I fix it?
  10. if getElementType(getElementData (source, "car")) == "vehicle" then WARNING: script\server.lua:47: Bad argument @ 'getElementType' [Expected element at argument 1] car=getElementData(source, "car") destroyElement(car) WARNING: script\server.lua:141: Bad argument @ 'destroyElement' [Expected element at argument 1] Why can't I use getElementData as an element? With what should I replace it in order for the script to output no errors or warnings?
  11. MTA gui system could really use an update. Sometimes when you place a button and press on the window, the button is pressed.
  12. Drakath

    Errors

    So I was working on my script today. Everything worked fine on my Tester server where I was alone but when I started the script in my main server with about 70 players it stopped working. My clientscript.log got spammed with these errors: [2014-01-11 16:21:21] ERROR: script.lua:0: attempt to perform arithmetic on a boolean value [2014-01-11 16:21:21] WARNING: script.lua:0: Bad 'element' pointer @ 'getElementPosition'(1) I think it happened when I made this: if count < tonumber(bots) then Anyway can someone tell me what do these errors mean?
  13. Drakath

    Vip Godmode

    function godmode () cancelEvent() end addEventHandler("onClientPlayerDamage", godmode)
  14. It works with fists. But I keep getting a nil value when I'm not near an obstacle. function get() local sx,sy,sz = getPedTargetCollision(localPlayer) outputChatBox(sx..", "..sy) end addEventHandler("onClientPreRender",getRootElement(),get) How can I fix it?
  15. https://wiki.multitheftauto.com/wiki/Scripting_Introduction#Where_are_all_the_scripts.3F
  16. Does 'getPedTargetCollision' work with fists? I tried to use it for my zombies but it returned boolean.
  17. It would be nice if MTA had Client side function to check if client pedestrian is dead.
  18. Drakath

    dxDrawLine3D

    I am making a laser script but I have a problem. Everything works fine except that the end of line doesn't go where it suppose to go. I used getPedTargetCollision to retrieve the coordinates of endX, endY, endZ. But this is what happened: Does anyone know a function that could retrieve the coordinates which would point the laser where the weapon muzzle is pointing ?
  19. Try to script it yourself with the functions provided and we will tell you what's wrong.
  20. table.random createMarker onMarkerHit setTimer setElementData getElementData givePlayerMoney triggerClientEvent guiCreateProgressBar createBlip
  21. That means your coordinates are wrong. Change the moveObject coordinates.
×
×
  • Create New...