Is there an alternative to GetPlayerWeaponData?
#2

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:
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;
}
And many functions can be build... (checkout playerfuncs.inc: https://sampforum.blast.hk/showthread.php?tid=573961, got afew functions)
Reply


Messages In This Thread
Is there an alternative to GetPlayerWeaponData? - by DTV - 25.06.2015, 06:43
Re: Is there an alternative to GetPlayerWeaponData? - by Gammix - 25.06.2015, 07:21
Re: Is there an alternative to GetPlayerWeaponData? - by Kyle - 25.06.2015, 07:31
Re: Is there an alternative to GetPlayerWeaponData? - by Yashas - 25.06.2015, 10:23
Re: Is there an alternative to GetPlayerWeaponData? - by Kar - 26.06.2015, 17:15

Forum Jump:


Users browsing this thread: 1 Guest(s)