Noah_Antilles

Members
  • Content count

    41
  • Joined

  • Last visited

Community Reputation

9 Neutral

About Noah_Antilles

  • Rank
    Rat

Details

  • Gang
    San Andreas Airmen
  • Location
    Bayside
  • Occupation
    Pilot
  • Interests
    3D Modelling, scripting noob
  1. @IIYAMA Thanks again mate, small mistake I hadn't seen. It works now
  2. Hello! I have almost finished a script, but I have some trouble figuring this problem: What I want to do is to save a certain vehicleComponent's rotation, and call on that rotation/value later on. But I get the error: Attempt to perform arithmetic on global 'ox' (a nil value) From what I can see the setElementData doesn't save the original value for some reason. setElementData should save the rotation of "gear_f" here under the name "ox" (original rotation on x-axis) function shamalDisableGear() local vehicle = getPedOccupiedVehicle(localPlayer) local ox = getVehicleComponentRotation(vehicle, "gear_f") -- should save it here local originalRotation = setElementData(vehicle, "gear_f", ox, true) -- should save it here if(vehicle)then if getElementModel(vehicle) == 519 then toggleControl ("sub_mission", false) end end end addEventHandler ( "onClientPlayerVehicleEnter", getLocalPlayer(), shamalDisableGear ) Later on, when the setElementData is called by getElementData: function shamalGearFront(button, press) local vehicle = getPedOccupiedVehicle(localPlayer) if(vehicle)then if getElementModel(vehicle) == 519 then if button == "2" and (press) then if gearstate == 0 then local rx, ry, rz = getVehicleComponentRotation(vehicle, "gear_f") setTimer(function () rx = rx - 3 if rx < 0 then rx = 360 - rx end setVehicleComponentRotation(vehicle, "gear_f", rx-3, ry, rz) end,50,33) elseif gearstate == 1 then if getElementData(vehicle, "gear_f", ox, true) then -- it seems it doesn't save the original value (ox) setVehicleComponentRotation(vehicle, "gear_f", ox-90, oy, oz) setTimer(function () rx = rx +1 setVehicleComponentRotation(vehicle, "gear_f", rx+1, ry, rz) end,50,90) end end end end end end addEventHandler ( "onClientKey", root, shamalGearFront ) What is causing this problem? Thanks in advance for your help, -Noah
  3. @IIYAMA damn, this works perfectly aswell if you don't mind I have one last problem: When I press "u"" again the components with negative values move another -90 degrees instead of rotating to their original location. The components using a positive value don't share this problem, they work perfectly. What can I do now?
  4. @IIYAMA It finally works! thanks for your help. I however have one more question, The opposite component also needs to rotate, but this time it needs to rotate -90 degrees instead of +90 degrees. When I do this however I get the debugging error: "expected positive, got negative" which makes me think that rotating components using a minus/negative value is not possible. But it should be possible, some way or another.. right?
  5. @3laa33 It's a custom component I named that way. It works because it used to move with my old script. @IIYAMA I tried putting it inside the function. It works for half a second, and then stops again. Where do I need to put it exactly?
  6. @IIYAMA I'm not that incompetent. debugging didn't give any error, hence why I simply told @3laa33 that it doesn't work. The component's name is correct, I double checked it. How do I update the ry value?
  7. Thanks for replying @3laa33 I tried your script but it doesn't work, nothing happens when I press u
  8. I've posted the same script sometime ago, but it turned out it wasn't the scripts fault, but rather a problem with the model. Now I am wondering how I can smoothly rotate a vehicle component. Right now when I press "u" the component instantly moves 90 degrees, but I'd much rather have that it rotates gradually. Much like in this video: https://www.youtube.com/watch?v=Rg-BAa7gvuw&feature=youtu.be&t=45s Here's my script: function shamalFunctions() local vehicle = getPedOccupiedVehicle(localPlayer) local x, y, z = getVehicleComponents(vehicle, "gearflapleft" ) if(vehicle)then if getElementModel(vehicle) == 519 then local rx, ry, rz = getVehicleComponentRotation(vehicle, "gearflapleft") setVehicleComponentRotation(vehicle, "gearflapleft", rx, ry+90, rz) end end end bindKey("u", "down", shamalFunctions) Thanks for your time -Noah
  9. Thanks for your help @Einheit-101 It fixed my problem. I would've never figured this out on my own, so thanks a lot
  10. Hey guys, In a model I've added a custom vehicle component (gearflapleft) What it is supposed to do is rotate 90 degrees when I press u. This works perfectly, however, It also scales the component about three times larger. What's going on here? function shamalFunctions() local vehicle = getPedOccupiedVehicle(localPlayer) local x, y, z = getVehicleComponents(vehicle, "gearflapleft" ) if(vehicle)then if getElementModel(vehicle) == 519 then local rx, ry, rz = getVehicleComponentRotation(vehicle, "gearflapleft") setVehicleComponentRotation(vehicle, "gearflapleft", rx, ry+90, rz) end end end bindKey("u", "down", shamalFunctions) Pics for a better explanation: https://gyazo.com/a41f4801a76a3894671452f0598ac814 https://gyazo.com/b399008953774d5216db6f30f9895dde Thanks for your help!
  11. Thanks
  12. Heya, This is a small project I've spend three days on so far. I was bored of the same old desert so I decided to add a canyon. I feel like this gives the desert a fresh, new feeling while still retaining the good ol' San Andreas vibe. https://www.youtube.com/watch?v=RwetzEnNs-8&feature=youtu.be Things I've yet got to do: Create LOD models. Prelight the models so they fit in more with the enviroment. Small tweaks here and there. Let me know what you think! -Noah
  13. Heya there Dutchman, I was looking into using custom shaders in order to have unique vehicles in my server. Am I allowed to use this in my server? I´ll of course give you and Ren_712 credit for this script. Thanks in advance, -Noah
  14. Thank you for your wonderful replies with explanation ^^ I will try my best to fix it
  15. Thanks for your reply. Well I guess I do want to make a serverside script, but I've never made one before, so that's quite a challenge I have no idea where to begin honestly. could you give me some more info where to start: How can I make two scripts (one serverside & one clientside) work together? As far as I can see the setElementData causes most problems. Is there something else I can use? Thanks for your time