SA-MP Forums Archive
is it possible to improve speed while running ? - 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: is it possible to improve speed while running ? (/showthread.php?tid=393196)



is it possible to improve speed while running ? - Horrible - 17.11.2012

pawn Код:
new Float:vx,Float:vy,Float:vz;
GetPlayerVelocity(playerid,vx,vy,vz);
SetPlayerVelocity(playerid,vx*1.5,vy*1.5,vz*1.5);
that code work well when i am on air, but when walking it not work.

it is possible to improve speed while running/walking ?


Re: is it possible to improve speed while running ? - Horrible - 17.11.2012

anyone help ?


Re: is it possible to improve speed while running ? - Jarnu - 17.11.2012

Maybe by detecting the player's PRESSED key as KEY_SPACE or KEY_SPRINT under OnPlayerKeyStateChange. for detecting help browse WIKI .


Re: is it possible to improve speed while running ? - Mr.Anonymous - 17.11.2012

Quote:
Originally Posted by Horrible
Посмотреть сообщение
that code work well when i am on air, but when walking it not work.
What do you mean by that? While in plane?


Re: is it possible to improve speed while running ? - Horrible - 17.11.2012

Quote:
Originally Posted by Mr.Anonymous
Посмотреть сообщение
What do you mean by that? While in plane?
In the air mean that while I am not touch the ground and not ride any vehicle

Ok I will try to do that.

edittill same wont work


Re: is it possible to improve speed while running ? - zDivine - 17.11.2012

Try setting a run animation when they are pressing 'KEY_SPRINT'.


Re: is it possible to improve speed while running ? - Horrible - 18.11.2012

Quote:
Originally Posted by zDivine
Посмотреть сообщение
Try setting a run animation when they are pressing 'KEY_SPRINT'.
sry i dont understand please give me a code


Re: is it possible to improve speed while running ? - Mauzen - 18.11.2012

It doesnt work on foot, as the player is "attached" to the ground. It works when he leaves the ground (e.g. jumping) but while running he wont get faster with SetPlayerVelocity, he might just get some damage.


Re: is it possible to improve speed while running ? - Horrible - 18.11.2012

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
It doesnt work on foot, as the player is "attached" to the ground. It works when he leaves the ground (e.g. jumping) but while running he wont get faster with SetPlayerVelocity, he might just get some damage.
so improve speed while running is impossible ?


Re: is it possible to improve speed while running ? - Mauzen - 18.11.2012

At least in a proper way it is impossible. All you could do is to add a bit of z velocity, so the player is jumping a bit, then you can set the speed with SetPlayerVelocity. But i guess that would look ugly and make controlling hard.