0 Members and 1 Guest are viewing this topic.
type tplayer = recordlevel: integer;damage: double;end;procedure IncXP(ID: longint;XP: double);begin soldier[ID].xp := soldier[ID].xp + XP; if (soldier[ID].xp >= soldier[ID].maxXP) then beginsoldier[ID].level := soldier[ID].level+1;soldier[ID].damage := soldier[ID].damage + 0.03;end;end;function Save(ID: longint; Name,Pass,Action: string): boolean;begin[...]if WriteFile('accounts/'+Name+'.ini',[...]'Damage='+FloatToStr(soldier[ID].damage)+chr(13)+chr(10)[...]end;function Load(ID: longint; Name,Pass: string): string;[...]try soldier[ID].damage := StrToFloat(ReadINI(file, 'STATS', 'Damage', '0')); except soldier[ID].damage := 0; end;[...]function OnPlayerDamage(Victim,Shooter: longint;Damage: longint) : longint;beginResult:=Damage*soldier[Shooter].damage; // HERE IS THIS ERROR "TYPE MISMATCH"//
function OnPlayerDamage(Victim,Shooter: longint;Damage: longint) : longint;var primary : longint; rands: longint;begin rands:= random(1,20); if(soldier[Shooter].spec = MARINE) and (Shooter <> Victim) then begin primary := GetPlayerStat(Shooter,'Primary'); if(primary = DEAGLES) or (primary = MINIMI) then begin if(Random(0,100) < ((soldier[Shooter].level*2)/3)) then begin Result := (Damage+(20*rands)); end; end; if(primary = FLAMER) then begin Result := Damage*3; end; end; if(soldier[Shooter].spec = COMMANDO) and (Shooter <> Victim) then begin primary := GetPlayerStat(Shooter,'Primary'); if(primary = AK) or (primary = AUG) then begin if(Random(0,100) < ((soldier[Shooter].level*2)/3)) then begin Result := (Damage+(20*rands)); end; end; end; if(soldier[Shooter].spec = Artillery) and (Shooter <> Victim) then begin primary := GetPlayerStat(Shooter,'Primary'); if(primary = M79) or (primary = MINIGUN) then begin if(Random(0,100) < ((soldier[Shooter].level*2)/3)) then begin Result := (Damage+(20*rands)); end; end; end; if(soldier[Shooter].spec = Assault) and (Shooter <> Victim) then begin primary := GetPlayerStat(Shooter,'Primary'); if(primary = MP5) or (primary = SPAS) then begin if(Random(0,100) < ((soldier[Shooter].level*2)/3)) then begin Result := (Damage+(20*rands)); end; end; end; if(soldier[Shooter].spec = Assassin) and (Shooter <> Victim) then begin primary := GetPlayerStat(Shooter,'Primary'); if(primary = RUGER) or (primary = BARRET) then begin if(Random(0,100) < ((soldier[Shooter].level*2)/3)) then begin Result := (Damage+(20*rands)); end; end; end; Result:= Damage + Round(Damage*soldier[shooter].damage);end;
result:= round(result * (soldier[shooter].damage+1));