Jump to content

Help Us Plz And Thank u


Haze

Recommended Posts

Hi Everyone How Are You Im back Agine with New Question or New Script and i Hope that u Help me i Really Trust You

this script make Hydra go faster i made it with my Frined the problem that this script is not working can u Help us Guys and thank u

function sonicboom () 
  
speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)  
kmh = actualspeed * 180 
outputChatBox ( "Someguy's current velocity: " .. mps .. " metres per second." ) 
    if kmh = < 130 then 
        playSound("boom.mp3") 
        setVehicleHandling(520, "maxVelocity", 200) 
    end 
end 
  
  bindKey ( "lshift", "down", sonicboom )  

Link to comment
function sonicboom () 
speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
kmh = actualspeed * 180 
outputChatBox ( "Someguy's current velocity: " .. mps .. " metres per second." ) 
    if kmh >= 130 then 
        playSound("boom.mp3") 
        setVehicleHandling(520, "maxVelocity", 200) 
    end 
end 
bindKey ( "lshift", "down", sonicboom )  

P.S: When you use outputChatBox in client side, none else but the client will see it.

Link to comment
function sonicboom () 
speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
kmh = actualspeed * 180 
outputChatBox ( "Someguy's current velocity: " .. kmh .. " metres per second." ) 
    if kmh >= 130 then 
        playSound("boom.mp3") 
        setVehicleHandling(520, "maxVelocity", 200) 
    end 
end 
bindKey ( "lshift", "down", sonicboom )  

try this

Link to comment

setVehicleHandling requires a vehicle element, not a vehicle model if I'm right.

function sonicboom () 
speedx, speedy, speedz = getElementVelocity ( getPlayerFromName ( "someguy" ) ) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
kmh = actualspeed * 180 
outputChatBox ( "Someguy's current velocity: " .. mps .. " metres per second." ) 
    if kmh >= 130 then 
        playSound("boom.mp3") 
        setVehicleHandling(getPedOccupiedVehicle(getPlayerFromName ( "someguy" )), "maxVelocity", 200) 
    end 
end 
bindKey ( "lshift", "down", sonicboom )  

Link to comment

-- client side:

addEvent("playSonicSound",true) 
addEventHandler("playSonicSound",root, 
function () 
    if isElement(sound) then destroyElement(sound) end 
    sound = playSound("boom.mp3") 
end) 

-- server side:

addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in pairs(getElementsByType("player")) do 
        bindKey ( player, "lshift", "down", sonicboom ) 
    end 
end) 
  
addEventHandler("onPlayerJoin",root, 
function () 
    bindKey ( source, "lshift", "down", sonicboom ) 
end) 
  
function sonicboom (player) 
if not isPedInVehicle(player) then return end 
speedx, speedy, speedz = getElementVelocity ( getPedOccupiedVehicle(player) ) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
kmh = actualspeed * 180 
outputChatBox ( getPlayerName(player) .." current velocity: " .. kmh .. " metres per second." ) 
    if kmh >= 130 then 
        triggerClientEvent(player,"playSonicSound",player) 
        setVehicleHandling(getPedOccupiedVehicle(player), "maxVelocity", 200) 
    end 
end 

Link to comment

Well, the script himself works, but I have no idea how handling stuff works. Maybe you should use velocity instead of handling.

-- client side:

addEvent("playSonicSound",true) 
addEventHandler("playSonicSound",root, 
function () 
    if isElement(sound) then destroyElement(sound) end 
    sound = playSound("boom.mp3") 
end) 

-- server side:

addEventHandler("onResourceStart",resourceRoot, 
function () 
    for index, player in pairs(getElementsByType("player")) do 
        bindKey ( player, "lshift", "down", sonicboom ) 
    end 
end) 
  
addEventHandler("onPlayerJoin",root, 
function () 
    bindKey ( source, "lshift", "down", sonicboom ) 
end) 
  
function sonicboom (player) 
if not isPedInVehicle(player) then return end 
local speedx, speedy, speedz = getElementVelocity ( getPedOccupiedVehicle(player) ) 
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5) 
kmh = actualspeed * 180 
outputChatBox ( getPlayerName(player) .." current velocity: " .. kmh .. " metres per second." ) 
    if kmh >= 130 then 
        triggerClientEvent(player,"playSonicSound",player) 
        setElementVelocity ( getPedOccupiedVehicle(player), speedx*1.05, speedy*1.05, speedz*1.05) 
    end 
end 

Link to comment

Funny to see how it takes almost 20 replys to know setVehicleHandling does NOT support boats, planes and helicopters yet. You can change the values, and some like suspension and steering lock will work, but planes, boats and helicopters have also special handling which are not able to get changed yet.

To make a hydra faster, use setElementSpeed in onClientPreRender, or wait till MTA 1.2 where there might be suport for special handling.

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