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



Player flying - MerryDeer - 03.09.2016

Hi,

How to make that?

https://www.youtube.com/watch?v=KO7pHC1q_zE


Re: Player flying - SoLetsGO - 03.09.2016

You have to detect if the player is hitting the other player.
Then you need some kind of animation for the player and then you can make him flying using SetPlayerVelocity


Re: Player flying - MerryDeer - 03.09.2016

What numbers i need to use in setplayervelocity to make that?


Re: Player flying - SoLetsGO - 03.09.2016

Well there should be something you have to do.
Try to make a command:
PHP код:
CMD:setvel(playerid,params[])
{
new 
Float:x,Float:y,Float:z;
sscanf(params,"fff",x,y,z);
SetPlayerVelocity(playerid,x,y,z);
return 
1;

Then just use the command to find out which value you need.


Re: Player flying - MerryDeer - 03.09.2016

Yes, but it always set velocty in what direction in what facing, i want that it changes by front of my, like getxyinfrontofplayer,


Re: Player flying - Stinged - 03.09.2016

Use GetXYInFrontOfPlayer on the player holding the baseball, and then loop to check who's standing in front of them.
After that, use this:
Код:
new Float: X, Float: Y, Float: A;
GetPlayerFacingAngle(playerid, A);
X = floatsin(-A, degrees);
Y = floatcos(-A, degrees);
SetPlayerVelocity(TARGETID, floatmul(ENTERY_VELOCITY, X), floatmul(ENTER_VELOCITY, Y), ENTER_Z);



Re: Player flying - MerryDeer - 03.09.2016

Thanks!!!!

And what animation is in what video?