0 Members and 1 Guest are viewing this topic.
if players[Shooter].lootammo > 0 then if random(alootammo[players[shooter].lootammo].brange,25) >= 0 then beginammo := round(strtoint(inigetvalue(weapons,WeaponNameByNum(getplayerstat(shooter,'primary')),'Ammo','100'))/2) +round(random(strtoint(inigetvalue(weapons,WeaponNameByNum(getplayerstat(shooter,'primary')),'Ammo','100'))/-4,strtoint(inigetvalue(weapons,WeaponNameByNum(getplayerstat(shooter,'primary')),'Ammo','100'))/4));Faddammo(shooter,ammo);end;
procedure Faddammo(ID: byte; ammo: integer);var fammo, buff1: integer;beginfammo := ammo;buff1 := strtoint(inigetvalue(weapons,WeaponNameByNum(getplayerstat(ID,'primary')),'Ammo','10'));if fammo = 0 then fammo := 1;if (getplayerstat(ID,'ammo') + ammo) > buff1 then fammo := (buff1 - getplayerstat(ID,'ammo'));Forceweapon(ID,getplayerstat(ID,'primary'),getplayerstat(ID,'secondary'),getplayerstat(ID,'ammo')+fammo);if getplayerstat(ID,'alive') then WriteConsole(ID,'Looted -:- ' + inttostr(fammo) + ' ammo',$ff5555ff);{WriteConsole(ID,'Debugging',$ff5555ff);WriteConsole(ID,'fammo = ' + inttostr(fammo),$ff5555ff);WriteConsole(ID,'your ammo = ' + inttostr(getplayerstat(ID,'ammo')),$ff5555ff);WriteConsole(ID,'max ammo = ' + inttostr(buff1),$ff5555ff);}end;
procedure IncAmmo(ID: byte);var Max, aAdd: byte;begin Max:= StrToInt(ReadINI('weapons_realistic.ini',WeaponNameByNum(GetPlayerStat(ID,'Primary')),'Ammo','7')); aAdd:= Random(1,Max-GetPlayerStat(ID,'Ammo')+1); ForceWeapon(ID, GetPlayerStat(ID,'Primary'), GetPlayerStat(ID,'Secondary'), GetPlayerStat(ID,'Ammo')+aAdd); WriteConsole(ID,'+' + IntToStr(aAdd),$FFFFFF);end;
Also how many pelets does the spas fire?(need this to decrease the chace of crits fatalhits and loots)
ForceWeapon(ID, GetPlayerStat(ID,'Primary'), GetPlayerStat(ID,'Secondary'), GetPlayerStat(ID,'Ammo')+aAdd);
Forceweapon(ID,getplayerstat(ID,'primary'),getplayerstat(ID,'secondary'),getplayerstat(ID,'ammo')+fammo);