03.10.2011, 13:25
Hello, I have 1 question. I want to use this on OnPlayerUpdate:
Because OnPlayerUpdate gets called many times, is it possible that my callback OnPlayerChangeAmmo will be called on next player update, but wouldn't ended on the last ? Because earlier i had a bug with familiar script.
pawn Код:
public OnPlayerUpdate(playerid)
{
new weaponid = GetPlayerWeapon(playerid);
new ammo = GetPlayerAmmo(playerid);
if(ammo !- lastammo[playerid])
{
OnPlayerChangeAmmo(playerid,oldammo,newammo,weaponid);
lastammo[playerid] = ammo;
}
return 1;
}