Nerses Posted December 9, 2014 Share Posted December 9, 2014 Good evening friends. Need your help. I need a script that for example when the player approached the marker on the machine, and for automatically changing the machine settings on the ones I ask. In advance thank you very much for your help. Link to comment
.:HyPeX:. Posted December 9, 2014 Share Posted December 9, 2014 You're being very inconclusive, wich machine? wich settings? where? how? what? Link to comment
Nerses Posted December 10, 2014 Author Share Posted December 10, 2014 You're being very inconclusive, wich machine? wich settings? where? how? what? Sorry, I have a bad English. Need a script that when a car drove up and began to the marker that automatically changed the characteristics of the machine are the ones that I ask. Link to comment
Dealman Posted December 10, 2014 Share Posted December 10, 2014 You want to change the vehicle's handling if it hits a marker? In that case; onMarkerHit setVehicleHandling Link to comment
Nerses Posted December 11, 2014 Author Share Posted December 11, 2014 You want to change the vehicle's handling if it hits a marker? In that case; onMarkerHit setVehicleHandling Yes Yes!!! Well, the problem is that I have little knowledge of lua. Could you help if you are not difficult? Link to comment
Castillo Posted December 16, 2014 Share Posted December 16, 2014 Post what you have tried, so we can help you find your problem. Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 Guys once again explain. Need a script so when the player enters the car in the marker then it automatically change the settings on those machines that I asked. Link to comment
Bean666 Posted May 8, 2015 Share Posted May 8, 2015 (edited) try to check the setVehicleHandling function on the wiki and learn about it. once you're done create a marker here's an example of a marker , when a player hits the marker , it triggers the server event , this is client side, just change the marker x y z and what kind of settings on the machine you want? Client.lua local marker = createMarker( -1187.7109375, -1308.9765625, 152.9, "Cylinder", 0.7, 0, 100, 0, 150) addEventHandler("onClientMarkerHit", marker, function(player) if (player == localPlayer) then triggerServerEvent ("vehiclehandling",getLocalPlayer(),vehiclehandling) end end) here's an example that changes the car to very fast and damage proof from col , i copied the handlings on the wiki.(pardon if i have anything wrong , i'm kinda tired right now) Server.lua addEvent("vehiclehandling",true) addEventHandler("vehiclehandling",root, function() if ( getPlayerMoney (source) >= 0 ) then takePlayerMoney(source, 0) setVehicleHandling(source, "mass", 300.0) setVehicleHandling(source, "turnMass", 200) setVehicleHandling(source, "dragCoeff", 4.0 ) setVehicleHandling(source, "centerOfMass", { 0.0,0.08,-0.09 } ) setVehicleHandling(source, "percentSubmerged", 103) setVehicleHandling(source, "tractionMultiplier", 1.7) -- you can also put 1.8 setVehicleHandling(source, "tractionLoss", 1.0) setVehicleHandling(source, "tractionBias", 0.48) setVehicleHandling(source, "numberOfGears", 5) setVehicleHandling(source, "maxVelocity", 300.0) setVehicleHandling(source, "engineAcceleration", 90.0 ) setVehicleHandling(source, "engineInertia", 5.0) setVehicleHandling(source, "driveType", "rwd") setVehicleHandling(source, "engineType", "petrol") setVehicleHandling(source, "brakeDeceleration", 20.0) setVehicleHandling(source, "brakeBias", 0.60) setVehicleHandling(source, "steeringLock", 35.0 ) setVehicleHandling(source, "suspensionForceLevel", 0.85) setVehicleHandling(source, "suspensionDamping", 0.15 ) setVehicleHandling(source, "suspensionHighSpeedDamping", 0.0) setVehicleHandling(source, "suspensionUpperLimit", 0.15 ) setVehicleHandling(source, "suspensionLowerLimit", -0.16) setVehicleHandling(source, "suspensionFrontRearBias", 0.5 ) setVehicleHandling(source, "suspensionAntiDiveMultiplier", 0.0) setVehicleHandling(source, "seatOffsetDistance", 0.0) setVehicleHandling(source, "collisionDamageMultiplier", 0.00) setVehicleHandling(source, "monetary", 10000) setVehicleHandling(source, "modelFlags", 1002000) setVehicleHandling(source, "handlingFlags", 1000002) setVehicleHandling(source, "headLight", 3) setVehicleHandling(source, "tailLight", 2) setVehicleHandling(source, "animGroup", 4) end end) Edited May 8, 2015 by Guest Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 try to check the setVehicleHandling function on the wiki and learn about it.once you're done create a marker here's an example of a marker , when a player hits the marker , it triggers the server event , this is client side, just change the marker x y z and what kind of settings on the machine you want? local marker = createMarker( -1187.7109375, -1308.9765625, 152.9, "Cylinder", 0.7, 0, 100, 0, 150) addEventHandler("onClientMarkerHit", marker, function(player) if (player == localPlayer) then triggerServerEvent ("vehiclehandling",getLocalPlayer(),vehiclehandling) end end) here's an example that changes the car to very fast and damage proof from col , i copied the handlings on the wiki.(pardon if i have anything wrong , i'm kinda tired right now) addEvent("vehiclehandling",true) addEventHandler("vehiclehandling",root, function() if ( getPlayerMoney (source) >= 0 ) then takePlayerMoney(source, 0) setVehicleHandling(source, "mass", 300.0) setVehicleHandling(source, "turnMass", 200) setVehicleHandling(source, "dragCoeff", 4.0 ) setVehicleHandling(source, "centerOfMass", { 0.0,0.08,-0.09 } ) setVehicleHandling(source, "percentSubmerged", 103) setVehicleHandling(source, "tractionMultiplier", 1.7) -- you can also put 1.8 setVehicleHandling(source, "tractionLoss", 1.0) setVehicleHandling(source, "tractionBias", 0.48) setVehicleHandling(source, "numberOfGears", 5) setVehicleHandling(source, "maxVelocity", 300.0) setVehicleHandling(source, "engineAcceleration", 90.0 ) setVehicleHandling(source, "engineInertia", 5.0) setVehicleHandling(source, "driveType", "rwd") setVehicleHandling(source, "engineType", "petrol") setVehicleHandling(source, "brakeDeceleration", 20.0) setVehicleHandling(source, "brakeBias", 0.60) setVehicleHandling(source, "steeringLock", 35.0 ) setVehicleHandling(source, "suspensionForceLevel", 0.85) setVehicleHandling(source, "suspensionDamping", 0.15 ) setVehicleHandling(source, "suspensionHighSpeedDamping", 0.0) setVehicleHandling(source, "suspensionUpperLimit", 0.15 ) setVehicleHandling(source, "suspensionLowerLimit", -0.16) setVehicleHandling(source, "suspensionFrontRearBias", 0.5 ) setVehicleHandling(source, "suspensionAntiDiveMultiplier", 0.0) setVehicleHandling(source, "seatOffsetDistance", 0.0) setVehicleHandling(source, "collisionDamageMultiplier", 0.00) setVehicleHandling(source, "monetary", 10000) setVehicleHandling(source, "modelFlags", 1002000) setVehicleHandling(source, "handlingFlags", 1000002) setVehicleHandling(source, "headLight", 3) setVehicleHandling(source, "tailLight", 2) setVehicleHandling(source, "animGroup", 4) end end) create the marker is on the server side or client? Link to comment
Bean666 Posted May 8, 2015 Share Posted May 8, 2015 yes , on my code , the createmarker is client side the client is the one with , onClientMarkerHit and triggerserverevent while the server is the setvehiclehandlings you will know if where the function is compatible for , client function is red color while the server function is orange. Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 yes , on my code , the createmarker is client sidethe client is the one with , onClientMarkerHit and triggerserverevent while the server is the setvehiclehandlings you will know if where the function is compatible for , client function is red color while the server function is orange. I did but I have not token icon on the map does not appear Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 yes , on my code , the createmarker is client sidethe client is the one with , onClientMarkerHit and triggerserverevent while the server is the setvehiclehandlings you will know if where the function is compatible for , client function is red color while the server function is orange. the marker was able to create, now when I call it there is nothing does not change, what to do? here is the error [2015-05-08 22:03:21] WARNING: [gameplay]/qwerty/server.lua:37: Bad argument @ 'setVehicleHandling' [Expected vehicle at argument 1, got player] Link to comment
Bean666 Posted May 8, 2015 Share Posted May 8, 2015 for me there's no error what do you mean by token icon, you mean blip? use createBlip function Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 for me there's no errorwhat do you mean by token icon, you mean blip? use createBlip function the issue with the blip is already solved. Now when I pull up to the marker on the car then nothing happens Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 alright let me deal with this. client local marker = createMarker( -1187.7109375, -1308.9765625, 152.9, "Cylinder", 0.7, 0, 100, 0, 150) addEventHandler("onClientMarkerHit", marker, function(player) if (player == localPlayer) then triggerServerEvent ("vehiclehandling",getLocalPlayer(),vehiclehandling) end end) local blip = createBlip( -1187.7109375, -1308.9765625,0, 55, 0, 0, 0, 0, 0, 0, 250) setBlipVisibleDistance(blip, 1500) -- 150 é a distancia perfeita meta <meta> <info descirption="www.gta-arabs.com" type="script" name="safe zone" version="1.0" author="Co[L]a>3"/> <script src ="client.lua" type = "client" /> <script src ="server.lua" type = "server" /> </meta> server addEvent("vehiclehandling",true) addEventHandler("vehiclehandling",root, function() if ( getPlayerMoney (source) >= 0 ) then takePlayerMoney(source, 0) setVehicleHandling(source, "mass", 4500.0) setVehicleHandling(source, "turnMass", 200) setVehicleHandling(source, "dragCoeff", 4.0 ) setVehicleHandling(source, "centerOfMass", { 0.0,0.08,-0.09 } ) setVehicleHandling(source, "percentSubmerged", 103) setVehicleHandling(source, "tractionMultiplier", 1.7) -- you can also put 1.8 setVehicleHandling(source, "tractionLoss", 1.0) setVehicleHandling(source, "tractionBias", 0.48) setVehicleHandling(source, "numberOfGears", 5) setVehicleHandling(source, "maxVelocity", 300.0) setVehicleHandling(source, "engineAcceleration", 90.0 ) setVehicleHandling(source, "engineInertia", 5.0) setVehicleHandling(source, "driveType", "rwd") setVehicleHandling(source, "engineType", "petrol") setVehicleHandling(source, "brakeDeceleration", 20.0) setVehicleHandling(source, "brakeBias", 0.60) setVehicleHandling(source, "steeringLock", 35.0 ) setVehicleHandling(source, "suspensionForceLevel", 0.85) setVehicleHandling(source, "suspensionDamping", 0.15 ) setVehicleHandling(source, "suspensionHighSpeedDamping", 0.0) setVehicleHandling(source, "suspensionUpperLimit", 0.15 ) setVehicleHandling(source, "suspensionLowerLimit", -0.16) setVehicleHandling(source, "suspensionFrontRearBias", 0.5 ) setVehicleHandling(source, "suspensionAntiDiveMultiplier", 0.0) setVehicleHandling(source, "seatOffsetDistance", 0.0) setVehicleHandling(source, "collisionDamageMultiplier", 0.00) setVehicleHandling(source, "monetary", 10000) setVehicleHandling(source, "modelFlags", 1002000) setVehicleHandling(source, "handlingFlags", 1000002) setVehicleHandling(source, "headLight", 3) setVehicleHandling(source, "tailLight", 2) setVehicleHandling(source, "animGroup", 4) end end) Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 he means , use that function well there is a solution to the problem? Link to comment
Walid Posted May 8, 2015 Share Posted May 8, 2015 well there is a solution to the problem? local marker = createMarker( -1187.7109375, -1308.9765625, 152.9, "Cylinder", 0.7, 0, 100, 0, 150) addEventHandler("onMarkerHit", marker, function(player,matchDim) if (matchDim and isElement(player) and getElementType(player) == "player" then ) then if isPedInVehicle (player) then local vehicle = getPedOccupiedVehicle(player) VehicleHandling(player,vehicle) end end end ) function VehicleHandling(player,vehicle) if isElement(player) and vehicle then if ( getPlayerMoney (player) >= 0 ) then -- check the player money takePlayerMoney(player, 0) -- put how much you will take here setVehicleHandling(vehicle, "mass", 300.0) setVehicleHandling(vehicle, "turnMass", 200) setVehicleHandling(vehicle, "dragCoeff", 4.0 ) setVehicleHandling(vehicle, "centerOfMass", { 0.0,0.08,-0.09 } ) setVehicleHandling(vehicle, "percentSubmerged", 103) setVehicleHandling(vehicle, "tractionMultiplier", 1.7) -- you can also put 1.8 setVehicleHandling(vehicle, "tractionLoss", 1.0) setVehicleHandling(vehicle, "tractionBias", 0.48) setVehicleHandling(vehicle, "numberOfGears", 5) setVehicleHandling(vehicle, "maxVelocity", 300.0) setVehicleHandling(vehicle, "engineAcceleration", 90.0 ) setVehicleHandling(vehicle, "engineInertia", 5.0) setVehicleHandling(vehicle, "driveType", "rwd") setVehicleHandling(vehicle, "engineType", "petrol") setVehicleHandling(vehicle, "brakeDeceleration", 20.0) setVehicleHandling(vehicle, "brakeBias", 0.60) setVehicleHandling(vehicle, "steeringLock", 35.0 ) setVehicleHandling(vehicle, "suspensionForceLevel", 0.85) setVehicleHandling(vehicle, "suspensionDamping", 0.15 ) setVehicleHandling(vehicle, "suspensionHighSpeedDamping", 0.0) setVehicleHandling(vehicle, "suspensionUpperLimit", 0.15 ) setVehicleHandling(vehicle, "suspensionLowerLimit", -0.16) setVehicleHandling(vehicle, "suspensionFrontRearBias", 0.5 ) setVehicleHandling(vehicle, "suspensionAntiDiveMultiplier", 0.0) setVehicleHandling(vehicle, "seatOffsetDistance", 0.0) setVehicleHandling(vehicle, "collisionDamageMultiplier", 0.00) setVehicleHandling(vehicle, "monetary", 10000) setVehicleHandling(vehicle, "modelFlags", 1002000) setVehicleHandling(vehicle, "handlingFlags", 1000002) setVehicleHandling(vehicle, "headLight", 3) setVehicleHandling(vehicle, "tailLight", 2) setVehicleHandling(vehicle, "animGroup", 4) end end end Link to comment
Nerses Posted May 8, 2015 Author Share Posted May 8, 2015 well there is a solution to the problem? local marker = createMarker( -1187.7109375, -1308.9765625, 152.9, "Cylinder", 0.7, 0, 100, 0, 150) addEventHandler("onMarkerHit", marker, function(player,matchDim) if (matchDim and isElement(player) and getElementType(player) == "player" then ) then if isPedInVehicle (player) then local vehicle = getPedOccupiedVehicle(player) VehicleHandling(player,vehicle) end end end ) function VehicleHandling(player,vehicle) if isElement(player) and vehicle then if ( getPlayerMoney (player) >= 0 ) then -- check the player money takePlayerMoney(player, 0) -- put how much you will take here setVehicleHandling(vehicle, "mass", 300.0) setVehicleHandling(vehicle, "turnMass", 200) setVehicleHandling(vehicle, "dragCoeff", 4.0 ) setVehicleHandling(vehicle, "centerOfMass", { 0.0,0.08,-0.09 } ) setVehicleHandling(vehicle, "percentSubmerged", 103) setVehicleHandling(vehicle, "tractionMultiplier", 1.7) -- you can also put 1.8 setVehicleHandling(vehicle, "tractionLoss", 1.0) setVehicleHandling(vehicle, "tractionBias", 0.48) setVehicleHandling(vehicle, "numberOfGears", 5) setVehicleHandling(vehicle, "maxVelocity", 300.0) setVehicleHandling(vehicle, "engineAcceleration", 90.0 ) setVehicleHandling(vehicle, "engineInertia", 5.0) setVehicleHandling(vehicle, "driveType", "rwd") setVehicleHandling(vehicle, "engineType", "petrol") setVehicleHandling(vehicle, "brakeDeceleration", 20.0) setVehicleHandling(vehicle, "brakeBias", 0.60) setVehicleHandling(vehicle, "steeringLock", 35.0 ) setVehicleHandling(vehicle, "suspensionForceLevel", 0.85) setVehicleHandling(vehicle, "suspensionDamping", 0.15 ) setVehicleHandling(vehicle, "suspensionHighSpeedDamping", 0.0) setVehicleHandling(vehicle, "suspensionUpperLimit", 0.15 ) setVehicleHandling(vehicle, "suspensionLowerLimit", -0.16) setVehicleHandling(vehicle, "suspensionFrontRearBias", 0.5 ) setVehicleHandling(vehicle, "suspensionAntiDiveMultiplier", 0.0) setVehicleHandling(vehicle, "seatOffsetDistance", 0.0) setVehicleHandling(vehicle, "collisionDamageMultiplier", 0.00) setVehicleHandling(vehicle, "monetary", 10000) setVehicleHandling(vehicle, "modelFlags", 1002000) setVehicleHandling(vehicle, "handlingFlags", 1000002) setVehicleHandling(vehicle, "headLight", 3) setVehicleHandling(vehicle, "tailLight", 2) setVehicleHandling(vehicle, "animGroup", 4) end end end does not work Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now