SA-MP Forums Archive
Player speeds. - 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: Player speeds. (/showthread.php?tid=566447)



Player speeds. - Karan007 - 06.03.2015

Hey guys,
I have a question, how can i make a player speed very low whenever he is falling?


Re: Player speeds. - CalvinC - 06.03.2015

Use GetPlayerVelocity to check if his z angle is dropping too fast while not in any vehicle.
Then use SetPlayerVelocity to set his speed to something slower.


Re: Player speeds. - Karan007 - 06.03.2015

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Use GetPlayerVelocity to check if his z angle is dropping too fast while not in any vehicle.
Then use SetPlayerVelocity to set his speed to something slower.
I knew it lol but wasn't too sure. Thanks. Let me try it.


Re: Player speeds. - CalvinC - 06.03.2015

Something like this maybe:
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerVelocity(playerid, x, y, z);
if(z < -5) SetPlayerVelocity(playerid, x, y, -2); // Checks if the z speed is lower than -5, so it's etc. -6
    // If so, sets his z velocity to -2
But you'll have to experiment with it yourself, that's just a skeleton of how it'll work, you also need to find out what velocity's are needed.


Re: Player speeds. - Karan007 - 06.03.2015

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Something like this maybe:
pawn Код:
new Float:x, Float:y, Float:z;
GetPlayerVelocity(playerid, x, y, z);
if(z < -5) SetPlayerVelocity(playerid, x, y, -2); // Checks if the z speed is lower than -5, so it's etc. -6
    // If so, sets his z velocity to -2
But you'll have to experiment with it yourself, that's just a skeleton of how it'll work, you also need to find out what velocity's are needed.
Thanks bro i already made it by ****** search on WIKI, thanks any way


Re: Player speeds. - Karan007 - 06.03.2015

Hmmm... now i tested it the speed is the same lol... what to do now?


Re: Player speeds. - Pottus - 06.03.2015

People always try and give velocities some kind of bullshit arbitrary value either multiply or divide your velocity value! You should also actually print the velocity values and see what they are because you will see that CalvinC fucked up big time.

pawn Код:
if(z < -5) SetPlayerVelocity(playerid, x, y, -2); // Checks if the z speed is lower than -5, so it's etc. -6
This is bullshit.