31.12.2014, 09:32
Hello , i want that when player get jetpack by /jetpack and pressing "f" the jetpack removed from player body and when he again use /jetpack the same jetpack disappear and get attach to his body.
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(PRESSED(KEY_SECONDARY_ATTACK)) //> KEY_SECONDARY_ATTACK is "Enter" You can change it with key list that i copied link above
{
if(/* Your check variable here. (player has jetpack or no) */)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}
}
return 1;
}
if(/* Your check variable here. (player has jetpack or no) */)
{
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_NONE);
}