Jump to content

Aibo

Retired Staff
  • Posts

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. because theVehicle can be false if player is not in a vehicle. hence the bad argument.
  2. you need to call addEventHandler only once, and you have it in a loop. wepcol = createColCuboid ( 1495.6212158203, -3100.0891113281, 87.07982635498, 5, 5, 5 ) root = getRootElement() function render() dxDrawText("meep",329.0,412.0,482.0,425.0,tocolor(255,200,0,255),0.9,"default-bold","left","top",false,false,false) end function enter() addEventHandler("onClientRender", root, render) end addEventHandler("onClientColShapeHit", wepcol, enter) function leave() removeEventHandler("onClientRender", root, render) end addEventHandler("onClientColShapeLeave", wepcol, leave)
  3. maybe you have something missing, for example: a check if rroll is 2. and read about if/elseif in lua wiki, you dont have to «if then return» every time.
  4. dxDrawText does not return any elements, only true|false. it just renders the text for 1 (ONE) frame, so you have to call this function every frame (onClientRender event). and textitems is a different thing, read the wiki links.
  5. because 2nd argument in (server) command handler function is command name, which is a string. third (and the rest) are arguments. function lotto_roll(player, command, amount)
  6. nope, but you can try out 1.1 nightlies: https://nightly.multitheftauto.com/
  7. line 28: you have extra «end» before «else».
  8. Thanks but, i get the same error as before, at setElementID well that's strange, cause i had a server running and even have tested the code i posted above, it worked. EDIT:are you sure your server-side code is really server-side?
  9. in 1.0.4 it works only with GTA car colors. RGB colors available only in 1.1. as it clearly stated on the wiki page.
  10. i've added indentation to your code, try to find your mistake yourself.
  11. -- server addCommandHandler("letsroll", function(me) local x,y,z = getElementPosition(me) local car=createVehicle(411,x,y+3,z) local drv=createPed(104,x,y+2,z) setElementID(drv,"drv") warpPedIntoVehicle(drv,car) triggerClientEvent(me, "start", getRootElement()) end) -- client function ctrldrv() for ctrl,key in pairs(drvctrls) do setPedControlState(drv,ctrl,getKeyState(key)) end end addEvent("start",true) addEventHandler("start", getRootElement(), function () drv = getElementByID("drv") drvctrls = {accelerate="u",brake_reverse="j",vehicle_left="h",vehicle_right="k",steer_forward="x",steer_back="c",vehicle_look_left="e",vehicle_look_right="r"} addEventHandler("onClientPreRender", getRootElement(), ctrldrv) end)
  12. amount = tonumber(amount) if amount then -- ok else -- not ok end
  13. why you're executing commands when you can just execute the functions those commands execute? i bet Doomed_Space_Marine made this step-by-step with commands just for educational purposes.
  14. maybe Lua escapes the quotes, idk, i would never have thought of such a way of doing things :В
  15. i wont ask you why are you doing this through /run command. put other type of quotes inside that quotes. can't you see it's breaking the string? executeCommandHandler ( "run", playerSource, "setElementID(drv, 'drv')")
  16. Aibo

    array problem

    getRandomPlayer
  17. local x, y, z, rz = getElementPosition( player ) this does not return rotation so rz (table value at index 7) is nil, use getPedRotation: local x, y, z = getElementPosition( player ) local rz = getPedRotation( player )
  18. hint: onClientRender + getTickCount PS: https://community.multitheftauto.com/index.php?p= ... ils&id=450
  19. Aibo

    No explode car

    cancelling this event wont stop the explosion, tested that not long ago in some topic here
  20. try using thePreviousAccount in onPlayerLogout event (https://wiki.multitheftauto.com/wiki/OnPlayerLogout) edit: also you should probably set some initial values, because getAccountData can return false if no data was stored.
  21. Aibo

    No explode car

    getElementsByType() returns a table of elements. not a single element.
  22. Aibo

    please help

    i doubt anyone understands the f*** question.
  23. OMG read https://wiki.multitheftauto.com/wiki/Ser ... our_server https://wiki.multitheftauto.com/wiki/Resources
×
×
  • Create New...