0 Members and 1 Guest are viewing this topic.
procedure SetTopStats(ID: byte; stat: string);var t,oldscore: integer; bump: boolean; oldname: string;beginbump := false; if stat = 'kills' then begin for t := 1 to 20 do begin if (players[ID].kills > strtoint(readini('accounts/topscores.ini','kills',inttostr(t*10),'0'))) AND (bump = false) then begin oldname := readini('accounts/topscores.ini','kills',inttostr(t),'0'); oldscore := strtoint(readini('accounts/topscores.ini','kills',inttostr(t*10),'0')); inisetvalue(topscores,'kills',inttostr(t),getplayerstat(ID,'name')); inisetvalue(topscores,'kills',inttostr(t*10),inttostr(players[ID].kills)); inisetvalue(topscores,'kills',inttostr(t+1),oldname); inisetvalue(topscores,'kills',inttostr((t+1)*10),inttostr(oldscore)); bump := true; end; if bump then begin inisetvalue(topscores,'kills',inttostr(t+2),readini('accounts/topscores.ini','kills',inttostr(t+3),'0')); inisetvalue(topscores,'kills',inttostr((t+2)*10),readini('accounts/topscores.ini','kills',inttostr((t+3)*10),'0')); end; end; end; if stat = 'deaths' then begin for t := 1 to 20 do begin if (players[ID].deaths > strtoint(readini('accounts/topscores.ini','deaths',inttostr(t*10),'0'))) AND (bump = false) then begin oldname := readini('accounts/topscores.ini','deaths',inttostr(t),'0'); oldscore := strtoint(readini('accounts/topscores.ini','deaths',inttostr(t*10),'0')); inisetvalue(topscores,'deaths',inttostr(t),getplayerstat(ID,'name')); inisetvalue(topscores,'deaths',inttostr(t*10),inttostr(players[ID].deaths)); inisetvalue(topscores,'deaths',inttostr(t+1),oldname); inisetvalue(topscores,'deaths',inttostr((t+1)*10),inttostr(oldscore)); bump := true; end; if bump then begin inisetvalue(topscores,'deaths',inttostr(t+2),readini('accounts/topscores.ini','deaths',inttostr(t+3),'0')); inisetvalue(topscores,'deaths',inttostr((t+2)*10),readini('accounts/topscores.ini','deaths',inttostr((t+3)*10),'0')); end; end; end; if stat = 'streak' then begin for t := 1 to 20 do begin if (players[ID].streak > strtoint(readini('accounts/topscores.ini','streak',inttostr(t*10),'0'))) AND (bump = false) then begin oldname := readini('accounts/topscores.ini','streak',inttostr(t),'0'); oldscore := strtoint(readini('accounts/topscores.ini','streak',inttostr(t*10),'0')); inisetvalue(topscores,'streak',inttostr(t),getplayerstat(ID,'name')); inisetvalue(topscores,'streak',inttostr(t*10),inttostr(players[ID].streak)); inisetvalue(topscores,'streak',inttostr(t+1),oldname); inisetvalue(topscores,'streak',inttostr((t+1)*10),inttostr(oldscore)); bump := true; end; if bump then begin inisetvalue(topscores,'streak',inttostr(t+2),readini('accounts/topscores.ini','streak',inttostr(t+3),'0')); inisetvalue(topscores,'streak',inttostr((t+2)*10),readini('accounts/topscores.ini','streak',inttostr((t+3)*10),'0')); end; end; end; if stat = 'caps' then begin for t := 1 to 20 do begin if (players[ID].caps > strtoint(readini('accounts/topscores.ini','caps',inttostr(t*10),'0'))) AND (bump = false) then begin oldname := readini('accounts/topscores.ini','caps',inttostr(t),'0'); oldscore := strtoint(readini('accounts/topscores.ini','caps',inttostr(t*10),'0')); inisetvalue(topscores,'caps',inttostr(t),getplayerstat(ID,'name')); inisetvalue(topscores,'caps',inttostr(t*10),inttostr(players[ID].caps)); inisetvalue(topscores,'caps',inttostr(t+1),oldname); inisetvalue(topscores,'caps',inttostr((t+1)*10),inttostr(oldscore)); bump := true; end; if bump then begin inisetvalue(topscores,'caps',inttostr(t+2),readini('accounts/topscores.ini','caps',inttostr(t+3),'0')); inisetvalue(topscores,'caps',inttostr((t+2)*10),readini('accounts/topscores.ini','caps',inttostr((t+3)*10),'0')); end; end; end;inisave('accounts/topscores.ini',topscores);end;
settopstats(victim,'deaths')settopstats(killer,'kills');settopstats(killer,'streak');
function OnPlayerDamage(Victim,Shooter: Byte;Damage: Integer) : integer;var vamphp, ammo, vesthp: integer; ragem: single;beginif not (IGB[shooter].sdmg) AND (damage > 0) then result := round(strtofloat(inttostr(damage)) * IGB[shooter].bdamage);if IGB[shooter].sdmg then result := damage;if damage <= 0 then result := damage;vesthp := 0;ragem := 1;if getplayerstat(shooter,'vest') > 0 then vesthp := 100;if getplayerstat(victim,'human') then if IGB[shooter].kazi then dodamage(shooter,3900);if damage < 3900 then if damage > 0 then if getplayerstat(shooter,'human') then begin if shooter <> victim then begin if players[Shooter].fatalHon = 'on' then if random(afatalH[players[shooter].fatalH].brange,10) >= 0 then players[Shooter].fataldmg := 2000; if players[Shooter].crit > 0 then if random(acrit[players[shooter].crit].brange,25) >= 0 then players[Shooter].critm := 2; end; if players[Shooter].lootammo > 0 then if random(alootammo[players[shooter].lootammo].brange,25) >= 0 then begin ammo := 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; if players[Shooter].ragetime > 0 then ragem := arage[players[shooter].rage].dmgm; result := round(ragem * ((Players[Shooter].dmgm + players[shooter].critm) * (IGB[Shooter].BDamage * ((strtofloat(inttostr(Damage + players[shooter].fataldmg)) * (150 / strtofloat(inttostr(IGB[victim].BHealth + players[victim].health)))))))); if players[shooter].vamp > 0 then begin vamphp := round(strtofloat(inttostr(result))*avamp[players[shooter].vamp].hpp); if vamphp > ((150 - getplayerstat(shooter,'health')) + (vesthp - getplayerstat(shooter,'vest'))) then vamphp := ((150 - getplayerstat(shooter,'health')) + (vesthp - getplayerstat(shooter,'vest'))); dodamage(shooter,-vamphp); end; if players[shooter].fataldmg <> 0 then begin WriteConsole(shooter,'The power of mana surges through you, you got a fatal hit!',$ffFF1111); WriteConsole(victim,getplayerstat(shooter,'name') + ' hit you with a fatal hit!',$ffFF1111); players[shooter].fataldmg := 0; end; if players[shooter].critm <> 0 then begin WriteConsole(shooter,'The power of mana sparks through you, you got a critical hit!',$ffFF1111); WriteConsole(victim,getplayerstat(shooter,'name') + ' hit you with a critical hit!',$ffFF1111); players[shooter].critm := 0; end; if (IGB[Victim].mirror) then if (getplayerstat(victim,'alive')) then Mirror(victim,shooter,strtoint(inigetvalue(weapons,WeaponNameByNum(getplayerstat(shooter,'primary')),'BulletStyle','1')),result,strtoint(inigetvalue(weapons,WeaponNameByNum(getplayerstat(shooter,'primary')),'speed','10'))); if IGB[Victim].sdmg then if result / 4 < round(1+(getplayerstat(Shooter,'health') + getplayerstat(Shooter,'vest')) / IGB[victim].BDamage) then DoDamageBy(shooter,victim,result/4); if IGB[Victim].sdmg then if result / 4 > round(1+(getplayerstat(Shooter,'health') + getplayerstat(Shooter,'vest')) / IGB[victim].BDamage) then DoDamageBy(shooter,victim,((getplayerstat(Shooter,'health') + getplayerstat(Shooter,'vest'))-1));endif (IGB[Victim].BShowHP) AND (getplayerstat(victim,'health') > 0) then ShowHP(Victim,Shooter);end;
schroedinbug: A design or implementation bug in a program that doesn't manifest until someone reading source or using the program in an unusual way notices that it never should have worked, at which point the program promptly stops working for everybody until fixed. Though (like bit rot) this sounds impossible, it happens; some programs have harbored latent schroedinbugs for years.
I went to your wikilink and then found this while wikiing around. Just wanted to share.Quote from: The_Jargon_Fileschroedinbug: A design or implementation bug in a program that doesn't manifest until someone reading source or using the program in an unusual way notices that it never should have worked, at which point the program promptly stops working for everybody until fixed. Though (like bit rot) this sounds impossible, it happens; some programs have harbored latent schroedinbugs for years.
Ok I have everything I asked about working, thanks guys. One last thing: Since you can only have one draw text up at a time I wanted to make a full screen drawtext that displays all the timers and such I need it to. How do I add an 'enter' character so it will skip a line in the drawtext?
One turely last thing: How can you make certian bot not camp when it sees a barret or a ruger? Ive seen it on some zombie servers where the one type of zombie ignores the barret while the others are paralized with fear.
Quote from: Hacktank on February 25, 2009, 02:14:31 amOk I have everything I asked about working, thanks guys. One last thing: Since you can only have one draw text up at a time I wanted to make a full screen drawtext that displays all the timers and such I need it to. How do I add an 'enter' character so it will skip a line in the drawtext?chr(13) + chr(10) aka #13#10 (recommend to make a global constant :F ) Quote from: Hacktank on February 25, 2009, 02:14:31 amOne turely last thing: How can you make certian bot not camp when it sees a barret or a ruger? Ive seen it on some zombie servers where the one type of zombie ignores the barret while the others are paralized with fear.tried Camping=0 in the botfile?
Accuracy=0Shoot_Dead=0Grenade_Frequency=10000Camping=255
Accuracy=0Shoot_Dead=1Grenade_Frequency=10000Camping=0
[BOTS]Difficulty=100Chat=1Raycasting_Quality=12
iono... this bot camps on ruger/ret:Code: [Select]Accuracy=0Shoot_Dead=0Grenade_Frequency=10000Camping=255this one doesnt:Code: [Select]Accuracy=0Shoot_Dead=1Grenade_Frequency=10000Camping=0also, the first one will keep running if theres one of the second kind nearby :FEdit: last lines of soldat.ini if that matters:Code: [Select][BOTS]Difficulty=100Chat=1Raycasting_Quality=12