Plant cmd
#7

Quote:
Originally Posted by KinderClans
Посмотреть сообщение
The velocity, to check if player is in air.
Код:
new Float:vx, Float:vy, Float:vz;
GetPlayerVelocity(playerid, vx, vy, vz);

vz = VectorSize(vx, vy, vz); // Calculate the vector (movement speed)

if(floatabs(vz) < 0.05) // Player is not moving and most likely midair
{
// ...
}
It's nearly impossible to have a that small velocity midair because of gravity and you cannot simply hover somewhere. Make sure the player cannot abuse a feature that freezes them midair.
You might want to adjust 0.05 to a value that works better, find that out by testing.
Hacks/mods would be an exception obviously.

You could also make it so that planting is only possible while crouching (crouching isn't possible when not standing on the ground):

Код:
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_DUCK)
Or both.
Reply


Messages In This Thread
Plant cmd - by KinderClans - 08.09.2018, 09:07
Re: Plant cmd - by Hunud - 08.09.2018, 10:08
Re: Plant cmd - by NaS - 08.09.2018, 13:01
Re: Plant cmd - by KinderClans - 08.09.2018, 13:42
Re: Plant cmd - by NaS - 08.09.2018, 15:52
Re: Plant cmd - by KinderClans - 08.09.2018, 17:41
Re: Plant cmd - by NaS - 08.09.2018, 17:51
Re: Plant cmd - by Shinja - 08.09.2018, 19:35
Re: Plant cmd - by KinderClans - 09.09.2018, 07:57

Forum Jump:


Users browsing this thread: 2 Guest(s)