SetPlayerGravity?
#1

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?
Reply
#2

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
Reply
#3

Remembering, the default value is 0.008
Reply
#4

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
Reply
#5

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?
Reply
#6

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;
}
Reply
#7

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).
Reply
#8

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 :/
Reply
#9

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
Reply
#10

You can't set different gravity for different players. You can however create a very laggy fake gravity using SetPlayerPos and timers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)