08.09.2018, 17:51
Код:
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 { // ... }
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)