31.12.2014, 15:17
Yes HY's code will set a timer that will make it disappear after 5 seconds.
This is without timer if you don't want it.
pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_SECONDARY_ATTACK))
{
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z+1);
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
}
}
return 1;
}
CMD:jetpack(playerid, params[])
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
return 1;
}