01.08.2013, 17:00
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!.
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 GiveInfiniteAmmoToWeponSlot(playerid,weaponid,slotid=0) { new wid,ammo; if(slotid) { GetPlayerWeaponData(playerid,slotid,wid,ammo); else { wid = weaponid } GivePlayerWeapon(playerid,wid,10000); }
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); } }