04.03.2013, 15:39
I made a perm weapon system.
The player can hold only 2 weapons, primary and secondary.
My question is: How can I make an update to check if the player has ammo in the weapon and if not.
so the weapon variable will update. or I can use it on OnPlayerUpdate
I made the stocks which checks if the player has ammo so it will return the weapon id otherwise it will return 0 as no gun in the slot.
Where can I use it to update?
The player can hold only 2 weapons, primary and secondary.
My question is: How can I make an update to check if the player has ammo in the weapon and if not.
so the weapon variable will update. or I can use it on OnPlayerUpdate
I made the stocks which checks if the player has ammo so it will return the weapon id otherwise it will return 0 as no gun in the slot.
Where can I use it to update?
pawn Код:
stock GetPrimaryWeapon(playerid)
{
if(GetWeaponAmmo(playerid, PlayerInfo[playerid][pWep1]) > 0)
return PlayerInfo[playerid][pWep1];
else
return 0;
}
stock GetSecondaryWeapon(playerid)
{
if(GetWeaponAmmo(playerid, PlayerInfo[playerid][pWep2]) > 0)
return PlayerInfo[playerid][pWep2];
else
return 0;
}