Player speeds.
#1

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

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

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.
Reply
#4

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

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

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)