KeyStateChange update
#4

pawn Код:
static
    PlayerExtinguisherAmmo[MAX_PLAYERS],
    PlayerExtinguisherTimer[MAX_PLAYERS]
;
//...
forward ExtinguisherAmmoTimer(playerid);
public ExtinguisherAmmoTimer(playerid)
{
    if (--PlayerExtinguisherAmmo <= 0) {
        KillTimer(PlayerExtinguisherTimer);
        //eventually change weapon to something else so he can't use extinguisher anymore
    }
    return 1;
}
Now, OnPlayerKeyStateChange when fire button is pressed start this timer on repeat, and on button release kill it as well. Recharge the ammo when you deem it should be recharged.
Reply


Messages In This Thread
KeyStateChange update - by arjanforgames - 16.04.2015, 18:24
Re: KeyStateChange update - by Misiur - 16.04.2015, 19:04
Re: KeyStateChange update - by arjanforgames - 16.04.2015, 20:04
Re: KeyStateChange update - by Misiur - 16.04.2015, 21:56

Forum Jump:


Users browsing this thread: 1 Guest(s)