Manticore Posted August 27, 2017 Posted August 27, 2017 Hello there, I have been searshing for speed rockets and i found this: function drawLinesAcrossScreen() if getPedOccupiedVehicle(localPlayer) then if getElementModel(getPedOccupiedVehicle(localPlayer)) == 520 then ---Script--- local sx, sy = guiGetScreenSize() sx = sx / 2.10 sy = sy / 2.10 local maxHeight = 800 --speed-- speedx, speedy, speedz = getElementVelocity ( getPedOccupiedVehicle(localPlayer) ) actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) --mps = actualspeed * 350 kmh = actualspeed * 480 --mph = actualspeed * 111.847 --/speed-- but it doesn't work Please help me
Manticore Posted August 27, 2017 Author Posted August 27, 2017 I want my hydra vehicle shout speed rockets...
Master_MTA Posted August 27, 2017 Posted August 27, 2017 4 minutes ago, Mohamed Asad said: I want my hydra vehicle shout speed rockets... it's already can shout speed rockets? 1
Manticore Posted August 27, 2017 Author Posted August 27, 2017 The hydra vehicle its already shouting rockets.. butI need to make rockets fast. Anyone?
Master_MTA Posted August 28, 2017 Posted August 28, 2017 1 hour ago, Mohamed Asad said: The hydra vehicle its already shouting rockets.. butI need to make rockets fast. Anyone? getCommandsBoundToKey getFunctionsBoundToKey unbindKey bindKey the functions which will you need to create your own script 1
Mr.Loki Posted August 28, 2017 Posted August 28, 2017 4 hours ago, Mohamed Asad said: I want my hydra vehicle shout speed rockets... What you will need: onClientProjectileCreation - call a function to modify the projectile's speed getProjectileType - Check if the projectile type is 19(rocket) getElementModel - Check if the creator of the projectile is a hydra(model: 520) getElementVelocity - get the velocity of the projectile setElementVelocity - set the velocity of the rocket to the old velocity we just got and multiply all 3 values by a number for example 5
Master_MTA Posted August 28, 2017 Posted August 28, 2017 (edited) 4 hours ago, Mr.Loki said: What you will need: onClientProjectileCreation - call a function to modify the projectile's speed getProjectileType - Check if the projectile type is 19(rocket) getElementModel - Check if the creator of the projectile is a hydra(model: 520) getElementVelocity - get the velocity of the projectile setElementVelocity - set the velocity of the rocket to the old velocity we just got and multiply all 3 values by a number for example 5 hmmm my idea was to reset ctrl key and add the shot function to functions which it's bind to ctrl did you understand me? Edited August 28, 2017 by Master_MTA
Manticore Posted August 28, 2017 Author Posted August 28, 2017 Well, Actually I'm not good scripter.., Can you please give me a example?
Mr.Loki Posted August 28, 2017 Posted August 28, 2017 8 hours ago, Master_MTA said: hmmm my idea was to reset ctrl key and add the shot function to functions which it's bind to ctrl did you understand me? That's really unnecessary for what he's trying to accomplish. 4 hours ago, Mohamed Asad said: Well, Actually I'm not good scripter.., Can you please give me a example? local speed = 5 -- Define a a variable which determins the speed we will use later. function boostRockets ( creator ) if not creator then return end -- If there's no creator for the projectile then stop. local projType = getProjectileType( source ) -- Get the projectile type. local mdl = getElementModel(creator) -- Get the model of the creator. if projType == 19 and mdl == 520 then -- If the projectile is a rocket and the creator is a hydra. local vx,vy,vz = getElementVelocity( source ) -- Save the rocket's velocity. setElementVelocity( source, vx*speed,vy*speed,vz*speed ) -- Set the rocket's velocity to the velocity we saved and multiply it by the speed variable. end end addEventHandler( "onClientProjectileCreation", root, boostRockets ) -- when a projectile gets created call boostRockets.
ForLaXPy Posted August 28, 2017 Posted August 28, 2017 1 minute ago, Mohamed Asad said: Doesn't work and no errors... make sure that's in the meta file its server sided as if its client sided it wont work
Mr.Loki Posted August 28, 2017 Posted August 28, 2017 I just tested it and it works... Are you using custom rockets or something that changes the rockets from the hydra? Just now, ForLaXPy said: make sure that's in the meta file its server sided as if its client sided it wont work This is client side... onClientProjectileCreation
Manticore Posted August 28, 2017 Author Posted August 28, 2017 No. 7 minutes ago, Mr.Loki said: I just tested it and it works... Are you using custom rockets or something that changes the rockets from the hydra? This is client side... I'm not using custom rockets.. Anyone?
Master_MTA Posted August 28, 2017 Posted August 28, 2017 4 minutes ago, Mohamed Asad said: No. I'm not using custom rockets.. Anyone? just use my way unbind ctrl key from all functions then bind it again with your addition
Manticore Posted August 28, 2017 Author Posted August 28, 2017 Well, like i say. I'm not good scripter....
Mr.Loki Posted August 28, 2017 Posted August 28, 2017 Have you try setting the speed to a higher value?
Manticore Posted August 28, 2017 Author Posted August 28, 2017 Yes, I do. But its still not working...
Manticore Posted August 28, 2017 Author Posted August 28, 2017 <meta> <info name="rockets" author="mohamed" version="10.0" type="script" /> <script src="client.lua" type="client" cache="false" /> </meta>
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