Giving ammo
#5

GetPlayerWeaponData will provide you with the Weapon ID in the respective slot.Then use that ID and just set the ammo to 10000+ and done!.

Код:
stock GiveInfiniteAmmoToWeponSlot(playerid,weaponid,slotid=0)
{
    new wid,ammo;   
    if(slotid) { GetPlayerWeaponData(playerid,slotid,wid,ammo);
    else { wid = weaponid }
    GivePlayerWeapon(playerid,wid,10000);    
}
This code might do the job.You can provide slotid or weaponid, its optional.Call it with the correct arguments and it will work.List of weapon IDs are available at SAMP wiki.

EDIT:This will give infinity ammo for all the weapons.
Код:
stock GiveInfinityAmmoToAllWeapons(playerid)
{
    new wid,ammo; 
    for (new i = 0; i < 13; i++)
    {
         GetPlayerWeaponData(playerid, i,wid, ammo);
         GivePlayerWeapon(playerid,wid,10000); 
     }
}
Reply


Messages In This Thread
Giving ammo - by Necip - 01.08.2013, 16:39
Re: Giving ammo - by Yashas - 01.08.2013, 16:50
Re: Giving ammo - by BigGroter - 01.08.2013, 16:54
Re: Giving ammo - by Necip - 01.08.2013, 16:54
Re: Giving ammo - by Yashas - 01.08.2013, 17:00
Re: Giving ammo - by JimmyCh - 01.08.2013, 17:00
Re: Giving ammo - by Necip - 01.08.2013, 17:15

Forum Jump:


Users browsing this thread: 1 Guest(s)