25.06.2015, 07:21
No, it works perfect.
Actually there are few tricks or ways to do some stuff instead of using GetPlayerWeaponData. For example, you want to get the ammo of a weapon player is having, so people probably use GetPlayerWeaponData but there are alternatives such as this code:
And many functions can be build... (checkout playerfuncs.inc: https://sampforum.blast.hk/showthread.php?tid=573961, got afew functions)
Actually there are few tricks or ways to do some stuff instead of using GetPlayerWeaponData. For example, you want to get the ammo of a weapon player is having, so people probably use GetPlayerWeaponData but there are alternatives such as this code:
pawn Code:
stock GetPlayerWeaponAmmo(playerid, weaponid)
{
new current_weapon = GetPlayerWeapon(playerid);
new ammo = 0;
SetPlayerArmedWeapon(playerid, weaponid);
if(GetPlayerWeapon(playerid) == weaponid)
{
ammo = GetPlayerAmmo(playerid);
SetPlayerArmedWeapon(playerid, current_weapon);
}
return ammo;
}