0 Members and 1 Guest are viewing this topic.
(23:37:28) [*] [Error] King-Mode -> (OnPlayerDamage): Out Of Range
function OnPlayerDamage(Victim, Shooter: byte; damage: integer): integer;var Injury: double;begin Injury := Damage; Result := Damage; if (Victim <> Shooter) and (GetPlayerStat(Victim, 'team') = GetPlayerStat(Shooter, 'team')) then begin Injury := 0; end else begin Players[Victim].hp := Players[Victim].hp - Damage; if Players[Victim].hp <= 0 then begin Players[Victim].hp := 0; Injury := Damage; end else begin Injury := Damage * 150/Classes[Players[Victim].ClassID].Hp; end; end; Result := round(Injury);end;
if (Text = '/db') then begin if Players[ID].ClassID = 13 then begin if (Players[ID].Dead = True) then begin CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-5, -15, -1, 250, 5, ID); CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-5, 15, -1, 250, 5, ID); CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-7, -18, -1, 250, 5, ID); CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-7, 18, -1, 250, 5, ID); DrawText(ID, ' Let em burn!', 240, $FF0000, 0.1875, 50, 175); end; end; end;
const BREATH_COOLDOWN = 30;var cooldownVar: byte;procedure AppOnIdle(Ticks: integer);begin if cooldownVar > 0 then begin cooldownVar := cooldownVar - 1; if cooldownVar = 0 then WriteConsole(DragonPlayer, 'Breath cooled down!', $FF0000); end;end;function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;begin if (Text = '/db') then begin if Players[ID].ClassID = 13 then begin if (Players[ID].Dead = True) then begin if cooldownVar = 0 then begin CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-5, -15, -1, 250, 5, ID); CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-5, 15, -1, 250, 5, ID); CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-7, -18, -1, 250, 5, ID); CreateBullet(GetPlayerStat(ID,'X')-5, GetPlayerStat(ID,'Y')-7, 18, -1, 250, 5, ID); DrawText(ID, ' Let em burn!', 240, $FF0000, 0.1875, 50, 175); end else WriteConsole(ID, 'Skill not cooled down yet!', $FF0000); end; end else WriteConsole(ID, 'You are not the dragon!', $FF0000); end;end;
Players: array[1..NumOfPlayers] of tPlayer;
Classes: array[1..NumOfClasses] of tClass;
//classes initialization Classes[1].Name := 'King'; Classes[1].Dist := 70; Classes[1].Hp := 190; Classes[1].HealRate := 10; Classes[2].Name := 'Hunter'; Classes[2].Dist := 5; Classes[2].Hp := 160; Classes[2].HealRate := 11; Classes[3].Name := 'Knight'; Classes[3].Dist := 5; Classes[3].Hp := 150; Classes[3].HealRate := 19; Classes[4].Name := 'Assasin'; Classes[4].Dist := 5; Classes[4].Hp := 175; Classes[4].HealRate := 13; Classes[5].Name := 'Mage'; Classes[5].Dist := 5; Classes[5].Hp := 150; Classes[5].HealRate := 19; Classes[6].Name := 'Tank'; Classes[6].Dist := 5; Classes[6].Hp := 300; Classes[6].HealRate := 22; Classes[7].Name := 'Priest'; Classes[7].Dist := 100; Classes[7].Hp := 150; Classes[7].HealRate := 24; Classes[8].Name := 'Jumper'; Classes[8].Dist := 5; Classes[8].Hp := 150; Classes[8].HealRate := 17; Classes[9].Name := 'Kamikaze'; Classes[9].Dist := 5; Classes[9].Hp := 150; Classes[9].HealRate := 11; Classes[10].Name := 'Ghost'; Classes[10].Dist := 5; Classes[10].Hp := 150; Classes[10].HealRate := 20; Classes[11].Name := 'Demon'; Classes[11].Dist := 5; Classes[11].Hp := 150; Classes[11].HealRate := 11; Classes[12].Name := 'Bird'; Classes[12].Dist := 5; Classes[12].Hp := 150; Classes[12].HealRate := 17; Classes[13].Name := 'Dragon'; Classes[13].Dist := 5; Classes[13].Hp := 150; Classes[13].HealRate := 11; Classes[14].Name := 'Turncoat'; Classes[14].Dist := 5; Classes[14].Hp := 150; Classes[14].HealRate := 11; ResetFreePos();end;
begin players[i].Timer := players[i].Timer - 1; end;
//King skill "Armor" if (Text = '/skill1') then begin if Players[ID].ClassID = 1 then begin if (Players[ID].Timer = 0) then begin SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),19); DrawText(ID, ' Armor spawned!', 300,color3,0.10,0,20); Players[ID].Timer := Delay4; end else begin DrawText(ID,'Armor NOT ready!',300,color,0.10,0,20); end; end; end;
begin players[i].Timer := players[i].Timer - 1; if (players[i].Timer = 0) then WriteConsole(i, 'THE TEXT', $FF0000);end;