Jump to content

Ashur

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Ashur

  1. Thank you very much, everything seems to work ?
  2. Hello! Please help me figure out why the argument is not passed from the server side to the client, nothing is displayed in the chat. And the event itself is also not triggered, because the function is also not executed even if you perform actions without an argument. Previously, I had no problem with this, but something went wrong. I'm a newbie, sorry for the language, I use a translator Client side: addEvent("boatSail", true) addEventHandler ( "boatSail", root, function(text) outputChatBox(text) end) Server side: function cruisingBoat() local x, y, z = -2611.08203125, 1476.525390625, -0.55000001192093 local boat = createVehicle(453, x, y, z) local driver = createPed (120, x, y, z) warpPedIntoVehicle (driver, boat) local text = "123456" triggerClientEvent("boatSail", getRootElement(), text) end addEventHandler ( "onResourceStart", getRootElement(), cruisingBoat )
  3. Hello, I need to make a race, I started by placing checkpoints through the loop, but I ran into the fact that I do not understand how to correctly delete a checkpoint and then create a new one after the car has passed through the marker I'm newbie, 3 days in lua and I don't know English well, so I use a translator when creating a topic Code: function checkpointHit(hitElement, matchingDimension) if getElementType(hitElement)=="vehicle" then return true end end function Racing( thePlayer ) local x,y,z = getElementPosition(thePlayer) -- получаем позицию игрока x = x - 2 -- прибавляем число 5 к позиции по оси x local RaceVehicle = createVehicle ( 411, x, y, z ) -- create a vehicle. z, y, x = getElementRotation(RaceVehicle) setElementRotation ( RaceVehicle, z,y,x+180) warpPedIntoVehicle ( thePlayer, RaceVehicle ) local checkpoints = { { -316.20703125, 1398.3125, 71.81689453125 }, { -410.787109375, 1697.8046875, 39.512222290039 } } for k,v in pairs( checkpoints ) do local marker = createMarker ( v[1],v[2],v[3], 'checkpoint', 2.0, 209, 13, 13, 100 ) local blip = createBlipAttachedTo (marker, 0) addEventHandler("onMarkerHit", marker, function(hitElement, matchingDimension) if(checkpointHit(hitElement, matchingDimension) == true) then destroyElement ( marker ) destroyElement( blip ) end end) end end addEventHandler("onMarkerHit", raceStart, function(thePlayer) spawnPlayer(thePlayer, -303.2841796875, 1521.22265625, 75.359375) fadeCamera(thePlayer, true) setCameraTarget(thePlayer, source) Racing(thePlayer) end)
×
×
  • Create New...