-
Posts
1,105 -
Joined
-
Last visited
Everything posted by Aibo
-
because theVehicle can be false if player is not in a vehicle. hence the bad argument.
-
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)
-
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.
-
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.
-
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)
-
nope, but you can try out 1.1 nightlies: https://nightly.multitheftauto.com/
-
line 28: you have extra «end» before «else».
-
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?
-
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.
-
i've added indentation to your code, try to find your mistake yourself.
-
-- 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)
-
amount = tonumber(amount) if amount then -- ok else -- not ok end
-
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.
-
maybe Lua escapes the quotes, idk, i would never have thought of such a way of doing things :В
-
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')")
-
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 )
-
hint: onClientRender + getTickCount PS: https://community.multitheftauto.com/index.php?p= ... ils&id=450
-
cancelling this event wont stop the explosion, tested that not long ago in some topic here
-
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.
-
getElementsByType() returns a table of elements. not a single element.
-
i doubt anyone understands the f*** question.
-
и вам того же, и вас.
-
OMG read https://wiki.multitheftauto.com/wiki/Ser ... our_server https://wiki.multitheftauto.com/wiki/Resources
