slapztea

Members
  • Content Count

    229
  • Joined

  • Last visited

Community Reputation

7 Neutral

About slapztea

  • Rank
    Trick

Details

  • Gang
    pangea
  • Location
    pangea
  • Occupation
    pangea
  • Interests
    create own server

Recent Profile Visitors

404 profile views
  1. slapztea

    bindTheKeys

    you do not claim to be the best assistant on the forum? Thanks for one more resolved question!
  2. slapztea

    bindTheKeys

    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
  3. slapztea

    bindTheKeys

    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 outputChatBox("you are not in car", playerSource, 220, 220, 0) else outputChatBox("Not driver", playerSource, 220, 220, 0) end end addEvent ( "switchEngine", true ) addEventHandler( "switchEngine", root, switchEngine ) function bindTheKeys ( playerSource, commandName ) bindKey ( playerSource, "L", "down", switchEngine ) end addCommandHandler("engine",bindTheKeys) addEventHandler ( "onResourceStart", getRootElement(), bindTheKeys)
  4. slapztea

    bindTheKeys

    I, apparently, was mistaken with an error Error: Expected player at argument 1, got resource-data Is this another mistake?
  5. slapztea

    bindTheKeys

    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) Bad Argument @ "addEventHandler" [Expected element at argument 2, got nill]
  6. 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.
  7. @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
  8. very nice, everything works perfect, thank you very much!
  9. 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
  10. @The_GTA Okay, but if there are 2 cars nearby, and you need to close only one of them
  11. @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)
  12. 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?
  13. /solved sorry
  14. I did through onPlayerVehicleEnter . When a player gets into the car at night, the headlights turn on for a split second, and after turn off. I would like that when the player got into the car of this inclusion for a split second did not happen The player got into the vehicle and the headlights were initially turned off and did not turn on
  15. Can I turn off the automatic inclusion of headlights at night? Even if I use the command setVehicleLightState the car still turns on the lights for a split second and then turn off even if I indicated that they are off. I mean, there should be no headlights on for a split second. need just force off