Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

7 Neutral

About factlight

  • Rank

Recent Profile Visitors

561 profile views
  1. ok, I understood how to implement this in your way. But if we consider from the point of view of comparing the speed of a car? if it is used only for cars and that there was a check for speed, and not for two coordinates. How to implement this?
  2. How can I calculate the meters traveled? For example, a player got in a car and drove 100 meters and this "100" save in elementData. I tried to work with it, but I don’t understand how to implement it correctly.
  3. Is it possible to run a function on an event when a player has loaded the server cache?
  4. you do not claim to be the best assistant on the forum? Thanks for one more resolved question!
  5. This does not work, I even tried another event(OnPlayerLogin), but the effect is the same. It doesn’t work, but as soon as I type the command into the chat (/engine) then everything works bindKey ( playerSource, "L", "down", switchEngine ) BadArgument 'binkKey' [Expected player at argument 1, got account
  6. Error on the same line addEventHandler ( "onResourceStart", getRootElement(), bindTheKeys) if use root instead getRootElement() the error is the same. so here is what i have --server function switchEngine ( playerSource) local theVehicle = getPedOccupiedVehicle ( playerSource ) if theVehicle and getVehicleController ( theVehicle ) == playerSource then local uid = getElementData(theVehicle, "uid") local state = getVehicleEngineState(theVehicle) outputChatBox("Driver", playerSource, 220, 220, 0) setVehicleEngineState(theVehicle,true) elseif not theVehicle then outputChat
  7. I, apparently, was mistaken with an error Error: Expected player at argument 1, got resource-data Is this another mistake?
  8. if you type the command into the chat /engine then it works as it should, but how to make the necessary function run with the resource without a command? I tried to do through onResourceStart but an error appears and I don’t understand how to solve it. how to fix it? --server side function bindTheKeys ( playerSource, commandName ) bindKey ( playerSource, "L", "down", switchEngine ) end addCommandHandler("engine",bindTheKeys) addEventHandler ( "onResourceStart", getRootElement(), bindTheKeys) error line: addEventHandler ( "onResourceStart", getRootElement(), bindTheKeys) B
  9. Everything works as it should, thanks. But I would like to know the nuances about the past code, what is wrong. I added delete colshape but did not post here.
  10. @The_GTA Hi again. One more question about this code. If there are no cars in the radius, how can I check this? For example, if there are no cars in the radius, a chat message is displayed
  11. very nice, everything works perfect, thank you very much!
  12. I made a parameter for each cars "uid" For example, we have setElementData(car,"uid",0) -- car1 setElementData(car,"uid",1) -- car2 How can I open / close, for example, a car with "uid" 0
  13. @The_GTA Okay, but if there are 2 cars nearby, and you need to close only one of them
  14. @Bartje I think it can help, but I don’t understand how to fix it. addCommandHandler("wv", function(player, cmd) local element = "vehicle" local radius = 3 local x, y, z = getElementPosition(player) local colshape = createColSphere(tonumber(x), tonumber(y), tonumber(z), tonumber(radius)) for index, value in ipairs(getElementsWithinColShape(colshape, element)) do setVehicleLocked ( element, true ) outputChatBox("lock", player, 220, 220, 0) end end)
  15. How can I interact with nearby vehicles? For example, a car is standing in front of me and I want to close or open door, namely it. How can I do it?
  • Create New...