Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/02/23 in all areas

  1. So I have an error that says Bad argument @ "getPedOccupiedVehicle" [Expected ped at argument 1, got nil] and I have no idea how to fix it. If someone could help me I would really appreciate it. local speed = 20 local buoyancy = 1.5 local drag = 1 function swimVehicle (vehicle, seat, jacked) local id = getPedOccupiedVehicle (vehicle) if id == 407 then local x, y, z = getElementPosition ( vehicle ) local level = getWaterLevel ( x, y, z ) if id == 407 and level and z < level then setElementData(vehicle, "buoyancy", 1.5) setElementData(vehicle, "vehicleDrag", 1) setElementData(vehicle, "centerOfMass", {0,0,-1}) setVehicleHandling(vehicle, "engineAcceleration", 20) else setElementData(vehicle, "buoyancy", 0) setElementData(vehicle, "vehicleDrag", 0) setVehicleHandling(vehicle, "engineAcceleration", 0) end end end addEventHandler("onClientRender", root, swimVehicle)
    1 point
  2. if you want more support please open a new thread and tag me, if you liked my help you can like my comments
    1 point
  3. GTA SA files walkthrough:
    1 point
  4. yes, you can be more careful in such matters, recheck the information about what you did well before saying anything. I always say, it may be better to test and submit the correct codes, because the codes we publish may contain erroneous or incomplete typos. When I will share code samples in the forum community I will try the codes on my own test server and share the codes properly to MTA players, thank you for your help, have a nice day And I can express my special thanks for helping the player.
    1 point
  5. Wow, indeed. I don't know why i did that way, Thank you So the verification must compared to an int value local id = getElementModel(getPedOccupiedVehicle(LocalPlayer)) if id == 407 then --YOUR CODE
    1 point
  6. hello there is error in your comment, I recommend you to use getElementModel instead of getElementID
    1 point
  7. getPedOccupiedVehicle() should be receiving LocalPlayer, and i will return the Element Vehicle. Then you can use GetElementID() to compare here. Something like this i believe: local id = getElementID(getPedOccupiedVehicle(LocalPlayer)) if id == '407' then --YOUR CODE If you have a doubt, just ask or if it helped, you can leave a thanks ?
    1 point
  8. Hi, welcome to the forums! Please download and run MTADiag and follow the instructions. Post any Pastebin URL MTADiag gives you.
    1 point
  9. well, I really don't know what to type there xd (it's that server-side script)
    0 points
×
×
  • Create New...