joaosilva099 Posted September 27, 2014 Share Posted September 27, 2014 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 Link to comment
joaosilva099 Posted September 27, 2014 Author Share Posted September 27, 2014 nobody? Link to comment
mustang Posted September 27, 2014 Share Posted September 27, 2014 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 Link to comment
joaosilva099 Posted September 28, 2014 Author Share Posted September 28, 2014 thanks men that worked but how can i only set the gravity only for local player? Link to comment
mustang Posted September 28, 2014 Share Posted September 28, 2014 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 Link to comment
joaosilva099 Posted September 28, 2014 Author Share Posted September 28, 2014 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 Link to comment
mustang Posted September 28, 2014 Share Posted September 28, 2014 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 Link to comment
joaosilva099 Posted September 28, 2014 Author Share Posted September 28, 2014 hum i tested it and checked on admin panel and the gravity was low Link to comment
mustang Posted September 28, 2014 Share Posted September 28, 2014 hum i tested it and checked on admin panel and the gravity was low Iam not sure about this but try getting someone in your server and test it Link to comment
Anubhav Posted September 28, 2014 Share Posted September 28, 2014 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. 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