Jump to content

[HELP]


Manticore

Recommended Posts

Hello there, I have been searshing for speed rockets and i found this:

  1. 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

Link to comment
4 hours ago, Mohamed Asad said:

I want my hydra vehicle shout speed rockets...

What you will need:

  1. onClientProjectileCreation - call a function to modify the projectile's speed
  2. getProjectileType - Check if the projectile type is 19(rocket)
  3. getElementModel - Check if the creator of the projectile is a hydra(model: 520)
  4. getElementVelocity - get the velocity of the projectile
  5. 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
Link to comment
4 hours ago, Mr.Loki said:

What you will need:

  1. onClientProjectileCreation - call a function to modify the projectile's speed
  2. getProjectileType - Check if the projectile type is 19(rocket)
  3. getElementModel - Check if the creator of the projectile is a hydra(model: 520)
  4. getElementVelocity - get the velocity of the projectile
  5. 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 by Master_MTA
Link to comment
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.

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...