Jump to content

[HELP]Jump Highter


joaosilva099

Recommended Posts

Posted

Hi all i'm making some script to my server and i have a problem. How can I enable the player to jump highter? (For who plays GTA SA and use codes I want to do what LFGMHAL code does)

Hope u can help me

TY

Posted
nobody?

Try using gravity for example :

Client Script :

  
function jump() 
    if not isPedInVehicle(getLocalPlayer()) then -- here you check if the player is not in a vehicle (in other words "on foot") 
     
        local moveState = getPedMoveState( getLocalPlayer() ) -- Get the player move state 
         
        if moveState == "jump" then 
         
            setGravity ( 0.001 ) 
             
        elseif moveState ~= "jump" then 
         
            setGravity ( 0.008 ) 
         
        end 
    end 
end 
addEventHandler("onClientRender", getRootElement(), jump)  
  
  
  

^tested and working

Posted
thanks men that worked but how can i only set the gravity only for local player?

You mean only for one player ? if so

i will add a command for the players that want to jump higher

  
  
playerDo = 0 -- Default Status , change to 1 if you want the default status ON which will make all players jump high when the resource start 
    function jump() 
if playerDo == 1 then 
        if not isPedInVehicle(getLocalPlayer()) then -- here you check if the player is not in a vehicle (in other words "on foot") 
        
            local moveState = getPedMoveState( getLocalPlayer() ) -- Get the player move state 
            
            if moveState == "jump" then 
            
                setGravity ( 0.001 ) 
                
            elseif moveState ~= "jump" then 
            
                setGravity ( 0.008 ) 
            
            end 
        end 
        end 
    end 
    addEventHandler("onClientRender", getRootElement(), jump) 
  
function jumpset() 
if playerDo == 0 then 
    outputChatBox("Cheat Activated", 0, 255, 0, true ) 
   playerDo = 1 
elseif playerDo == 1 then 
   outputChatBox("Cheat Deactivated", 255, 0, 0, true ) 
   setGravity ( 0.008 ) 
   playerDo = 0 
end 
end      
addCommandHandler("jumptoggle", jumpset) -- Command to toggle the status(Cheat) 
      

if you type /jumptoggle you will toggle it, default is off

Posted
i don't mean this. i mean when u jump the ALL server takes gravity low and i want only the local player to take the gravity so he can jump highter

Did you test the new script i gave you with someone ? cause it wont change the grav for all player in the newer one i gave you

Posted

How will it work like that? It will do it for each CLIENT.

You must trigger from server like this

Server:

  
      triggerClientEvent(someElement, "hi", someElement) 
  

Client:

  
addEvent("hi", true) 
addEventHandler('hi', root, function() 
     -- do stuff 
end 
  

This will be triggered for specified element/player.

This is only a example, do it yourself and tell us if you get a error.

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