[Include] SetPlayerGravity - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (
https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] SetPlayerGravity (
/showthread.php?tid=447408)
SetPlayerGravity -
IllidanS4 - 29.06.2013
This include allows you to change (although sometimes glithy) player's gravity. This does not change vehicles or other objects.
Installation
Place setgravity.inc to the include directory and add
#include <setgravity> directive to your gamemode or filterscript. Then add
SetGravity_OnPlayerConnect(playerid); to the OnPlayerConnect public function and
SetGravity_OnPlayerUpdate(playerid); to OnPlayerUpdate in your script.
Functions
SetPlayerGravity(playerid, Float:newgravity)
This sets player to use custom gravity system, which tries to mimic gravity effects. 0.008 corresponds to the default gravity. 0.0 gravity still makes the player descend, so you may use something around -0.02281.
ResetPlayerGravity(playerid)
This forces the player to use the default server gravity.
Download: pastebin.com/KPAwD6d2, save as setgravity.inc
Re: SetPlayerGravity -
Kreatyve - 29.06.2013
Should learn to hook your callbacks.
Re: SetPlayerGravity -
BloodMaster - 29.06.2013
Nice way of doing this, but we'll have to wait till Kalcor change up his mind to make this feature.
Till then, try to play with Vehicle Velocity.
Re: SetPlayerGravity -
kurta999 - 29.06.2013
Very nice idea! GG!
Anyway if someone need real SetPlayerGravity() write PM for me.