Jump to content

Danii.-

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Danii.-

  1. Hello guys! I have another problem. (/question) I am begginer in scripting, so sorry if it's a stup1d question... Is it possible to connect executeCommandHandler with an Event? Or if not do you have any ideas how to do it? It always gives me this error code: Bad argument @ 'executeCommandHandler' [Expected element at argument 2, got nil ] ( I am triggering the "fwheelset" event from the client-side with triggerServerEvent. ) function elsokerek( localPlayer, theVehicle ) local veh = getPedOccupiedVehicle ( localPlayer ) if veh then -- If valid vehicle local success = setVehicleHandling ( veh, "driveType", "fwd" ) -- Set the vehicle's drivetype if success then -- If it was succesful outputChatBox ( "oksa", source ) end end end addCommandHandler("fwd", elsokerek) addEvent("fwheelset",true) function setf ( playerSource ) executeCommandHandler ( "fwd", playerSource, "" ) end addEventHandler("fwheelset", root, setf)
  2. Thank you very much. Helped a lot. Solved.
  3. Hello guys, today i tried to make an traffipax script, but i got this error code: server.lua:212: Bad argument @ 'getPedOccupiedVehicle' [Expected ped at argument 1, got vehicle] Here is the code: local s1321321 = createColRectangle ( 1816.85632, -1793.69824, 13.38281, 1, 1) function bunti ( source ) local vehicle = getPedOccupiedVehicle(source) local velx, vely, velz = getElementVelocity( vehicle ) local speed = (velx ^ 2 + vely ^ 2 + velz ^ 2) ^ (0.5) local kmh = math.floor(speed * 180 ) local mgng = 50 local tul = kmh - mgng if theVehicle then if kmh > 50 then outputChatBox("#ff0000 *TRAFFIPAX* Sebességkorlát: 50km/h", source, 255, 194, 14, true) outputChatBox("#ff0000 *TRAFFIPAX* Sebességed:" ..kmh.. ". Bírság: 30000 Ft. Levonva a készpénzedből vagy a bankszámládról.", source, 255, 194, 14, true) outputChatBox("#ff0000 *TRAFFIPAX* Túllépés:" ..tul.."km/h.", source, 255, 194, 14, true) end end end addEventHandler ( "onColShapeHit", s1321321, bunti ) Solved.
×
×
  • Create New...