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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetPlayerGravity? (
/showthread.php?tid=348102)
SetPlayerGravity? -
mati233 - 04.06.2012
Hi,
I was looking for a way to set the player gravity, but the only thing I found was the YSF from ******, but it doesn't have support to 0.3e...
Does anyone have a simple solution for this?
Re: SetPlayerGravity? -
FalconX - 04.06.2012
Quote:
Originally Posted by mati233
Hi,
I was looking for a way to set the player gravity, but the only thing I found was the YSF from ******, but it doesn't have support to 0.3e...
Does anyone have a simple solution for this?
|
I believe you can only do is:-
pawn Код:
SetGravity( YOUR_GRAVITY ); // for the whole server (for each player)
Original Link:
https://sampwiki.blast.hk/wiki/SetGravity
_FalconX
Re: SetPlayerGravity? -
ViniBorn - 04.06.2012
Remembering, the default value is 0.008
Re: SetPlayerGravity? -
ss2119 - 04.06.2012
I dont Know how to chane the player gravity but i know how to change the default gravity what u have to do is add This FS (fsdebug) and type /g or /gravity and change to as u wish NOTE dont change to 10 or 5 it will kill u better 0.0008 for cool high jumping
Re: SetPlayerGravity? -
mati233 - 04.06.2012
Than you all for the suggestions, but I know the values I have to set, it will be 0.008 or 0.020, but I need to set it in different way for each player, no solution for this?
Re: SetPlayerGravity? -
Youice - 04.06.2012
I suggest you, to create your own "function" (basic function)
try this (I didn't even test it)
Код:
SetPlayerGravity(playerid, Float:gravity) {
#pragma unused playerid
SetGravity(gravity);
return 1;
}
example:
Код:
CMD:gravity(playerid, params[])
{
SetPlayerGravity(playerid, 0.008);
return 1;
}
Re: SetPlayerGravity? -
iggy1 - 04.06.2012
Quote:
Originally Posted by Youice
try this (I didn't even test it)
Код:
SetPlayerGravity(playerid, Float:gravity) {
#pragma unused playerid
SetGravity(gravity);
return 1;
}
|
If it was that simple there wouldn't be people creating plugins for it.
Also that function just calls "SetGravity". So the only difference between your function and "SetGravity" is that yours is slower, and has a pointless parameter (playerid).
Re: SetPlayerGravity? -
mati233 - 04.06.2012
Maybe one day ****** will update it, or maybe SAMP will include it in a future version, because it's really useful, that's a shame that we have no way to do that now :/
Re: SetPlayerGravity? -
[NWA]Hannes - 04.06.2012
This works:
if(strcmp(cmdtext,
"/setgravity",
true,
11)==
0)
{
if(!cmdtext[
11])
return SendClientMessage(playerid,
0xFF0000FF,
"Usage: /setgravity [gravity]");
SetGravity(cmdtext[
12]);
return 1;
}
although you should use a different command processor since strcmp is pretty slow
Re: SetPlayerGravity? -
3ventic - 04.06.2012
You can't set different gravity for different players. You can however create a very laggy fake gravity using SetPlayerPos and timers.