19.11.2013, 00:42
I would like to ask you to make a OnPlayerShoot(); include wait.... I have one.... Ok Emmetize this.
pawn Код:
#include <YSI\y_hooks>
forward OnPlayerShoot(playerid,weaponid,ammo);
static OldAmmo[MAX_PLAYERS], OldWeap[MAX_PLAYERS], CurrAmmo[MAX_PLAYERS], CurrWeap[MAX_PLAYERS];
hook OnPlayerUpdate(playerid)
{
// Get the current weapon and ammo
CurrWeap[playerid] = GetPlayerWeapon(playerid);
CurrAmmo[playerid] = GetPlayerAmmo(playerid);
// Player still has old weapon does this weapon now have less ammo?
if(CurrWeap[playerid] == OldWeap[playerid] && CurrAmmo[playerid] < OldAmmo[playerid])
{
CallLocalFunction( "OnPlayerShoot", "iii", playerid, CurrWeap[playerid], CurrAmmo[playerid]);
}
OldWeap[playerid] = CurrWeap[playerid];
OldAmmo[playerid] = CurrAmmo[playerid];
return 1;
}