0 Members and 2 Guests are viewing this topic.
Great! This helped me much I am currently trying to find a balanced damage incremention for the random function. Is there a way to detect the nearest enemy foe that is not dead?
[...] Some Procedure you may use.. //I don't know which one is it, so, fill this yourself. Var S: Byte; Dist: Single; //S = Player's ID. I entered S because I have no idea if in that procedure there is already a 'DC' Byte, so I entered 'S' of Squiddy :P. Dist is the distance used in RayCast(); Begin //Starts.. For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True Then Begin //Checks is target player is alive.. if RayCast(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(S,'X'),GetPlayerStat(S,'Y'),Dist,800) = True Then Begin //Check is player S is visible for player ID.. [...] //Here go whatever you want to put it in.. end; //Ending the RayCast() Function.. end; //Ending the GetPlayerStat() Function..end; //Ending the Procedure..
// Do additional damage to the next enemy after the Berserker killed someone.Procedure OnPlayerKill(Killer,Victim:byte;Weapon:byte); begin if Klasse[Killer] = 'Berserker' then begin Var S: Byte; Dist: Single; Begin For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True Then Begin if RayCast(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(S,'X'),GetPlayerStat(S,'Y'),Dist,800) = True Then Begin DoDamage(S,Killer,50); end; end; end;
10-04-10 19:26:44 [*] Compiling Knife Server -> KnifeServer.pas...10-04-10 19:26:44 [*] Knife Server -> [Error] (114:3): Identifier expected10-04-10 19:26:44 [*] Compilation Failed.10-04-10 19:26:44 Shutting down server...
10-04-10 21:36:10 [*] Compiling Knife Server -> KnifeServer.pas...10-04-10 21:36:10 [*] Knife Server -> [Error] (117:3): Identifier expected10-04-10 21:36:10 [*] Compilation Failed.10-04-10 21:36:10 Shutting down server...
Procedure OnPlayerKill(Killer,Victim:byte;Weapon:byte); begin if Klasse[Killer] = 'Berserker' then begin Var S: Byte; Dist: Single; begin For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True Then Begin if RayCast(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(S,'X'),GetPlayerStat(S,'Y'),Dist,800) = True Then Begin DoDamageBy(S,Killer,50); end; end; end;
Code: [Select]Procedure OnPlayerKill(Killer,Victim:byte;Weapon:byte); begin if Klasse[Killer] = 'Berserker' then begin Var S: Byte; Dist: Single; begin For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True Then Begin if RayCast(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(S,'X'),GetPlayerStat(S,'Y'),Dist,800) = True Then Begin DoDamageBy(S,Killer,50); end; end; end;
Procedure OnPlayerKill(Killer,Victim:byte;Weapon:byte);begin if Klasse[Killer] = 'Berserker' then begin Var S: Byte; Dist: Single; begin For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True Then Begin if RayCast(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(S,'X'),GetPlayerStat(S,'Y'),Dist,800) = True Then Begin DoDamageBy(S,Killer,50); end; end; end;
Procedure OnPlayerKill(Killer,Victim:byte;Weapon:byte);Var S: Byte; Dist: Single; //put variable declarations just after the definition of the procedure, but before the first beginbegin if Klasse[Killer] = 'Berserker' then begin For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True Then Begin if RayCast(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),GetPlayerStat(S,'X'),GetPlayerStat(S,'Y'),Dist,800) = True Then Begin DoDamageBy(S,Killer,50); end; end; end;end;
Procedure OnPlayerKill(Killer,Victim:byte;Weapon:byte); Var S: Byte; Dist,x,y: Single; begin if Klasse[Killer] = 'Berserker' then begin For S := 1 To 32 Do if GetPlayerStat(S,'Alive') = True then begin x := GetPlayerStat(S,'x'); y := GetPlayerStat(S,'y'); if not Raycast (x,y,x,y -3,Dist,20) then begin CreateBullet(x,y,1,1,100,4,Killer); WriteConsole(S,'You have just been blown up!', Color);end; end; end; end;
Weapon: byte; -> Weapon: string;
var Klasse: array[1..32] of string; SmnPower: array[1..32] of byte;
if LowerCase(Text) = '!mage' then begin WriteConsole(ID,'#You are now a MAGE!', Color); WriteConsole(ID,'#You are able to summon a minion when you have maximal', Color); WriteConsole(ID,'#summoning power (10). You get power for killing enemies.', Color); WriteConsole(ID,'#For every kill you gain one grenade, too!', Color); Klasse[ID] := 'Mage'; end; if LowerCase(Text) = '!summon' then begin if SmnPower = 10 then begin GetPlayerStat(ID,'Team'); Command('/addbot' + Team + ' Knife Minion'); WriteConsole(ID,'#You have summoned a minion! He will kill others for you!', Color); end; if SmnPower < 10 then begin WriteConsole(ID,'#Your summoning power is too low to summon the minion.', Color); end;
Procedure AppOnIdle(Ticks: Integer); var DC: Byte; begin for DC := 1 to 32 do if GetPlayerStat(DC,'Alive') = true then begin if Klasse[DC] = 'Mage' then begin if Ticks Mod (60 * 7) = 0 then ForceWeapon(DC,14,255,0); end; end;
Procedure OnPlayerKill(Killer,Victim:byte;Weapon:string); begin if Klasse[Killer] = 'Mage' then begin GiveBonus(Killer,4); SmnPower := SmnPower+1; if SmnPower > 10 then begin SmnPower := 10; end; WriteConsole(Killer,'You got a new grenade!',Color); WriteConsole(Killer,'Your summoning power is ' + + '/10!',Color) end;end;
Team := GetPlayerStat(ID, 'Team');Command('/setteam' + inttostr(Team) + ' Knife Minion');
var Klasse: array[1..32] of string; SmnPower: array[1..32] of byte;procedure OnPlayerSpeak(ID: byte; Text: string);begin if LowerCase(Text) = '!mage' then begin WriteConsole(ID,'#You are now a MAGE!', Color); WriteConsole(ID,'#You are able to summon a minion when you have maximal', Color); WriteConsole(ID,'#summoning power (10). You get power for killing enemies.', Color); WriteConsole(ID,'#For every kill you gain one grenade, too!', Color); Klasse[ID] := 'Mage'; end; if LowerCase(Text) = '!summon' then if SmnPower[ID] >= 10 then begin Command('/addbot' + inttostr(GetPlayerStat(ID, 'Team')) + ' Knife Minion'); WriteConsole(ID, 'You have summoned a minion! He will kill others for you!', Color); end else WriteConsole(ID, 'You summoning power is too low to summon the minion.', Color);end;Procedure AppOnIdle(Ticks: Integer);var DC: Byte;begin for DC := 1 to 32 do if GetPlayerStat(DC, 'Active') = true then if GetPlayerStat(DC, 'Alive') = true then if Klasse[DC] = 'Mage' then if Ticks Mod (60 * 7) = 0 then ForceWeapon(DC,14,255,0);end;var Klasse: array[1..32] of string; SmnPower: array[1..32] of byte;procedure OnPlayerSpeak(ID: byte; Text: string);begin if LowerCase(Text) = '!mage' then begin WriteConsole(ID,'#You are now a MAGE!', Color); WriteConsole(ID,'#You are able to summon a minion when you have maximal', Color); WriteConsole(ID,'#summoning power (10). You get power for killing enemies.', Color); WriteConsole(ID,'#For every kill you gain one grenade, too!', Color); Klasse[ID] := 'Mage'; end; if LowerCase(Text) = '!summon' then if SmnPower[ID] >= 10 then begin Command('/addbot' + inttostr(GetPlayerStat(ID, 'Team')) + ' Knife Minion'); WriteConsole(ID, 'You have summoned a minion! He will kill others for you!', Color); end else WriteConsole(ID, 'You summoning power is too low to summon the minion.', Color);end;Procedure AppOnIdle(Ticks: Integer);var DC: Byte;begin for DC := 1 to 32 do if GetPlayerStat(DC, 'Active') = true then if GetPlayerStat(DC, 'Alive') = true then if Klasse[DC] = 'Mage' then if Ticks Mod (60 * 7) = 0 then ForceWeapon(DC,14,255,0);end;Procedure OnPlayerKill(Killer,Victim:byte;Weapon:string); begin if Klasse[Killer] = 'Mage' then begin GiveBonus(Killer, 4); SmnPower[Killing] := SmnPower[Killer] + 1; if SmnPower > 10 then SmnPower := 10; WriteConsole(Killer, 'You got a new grenade!', Color); WriteConsole(Killer, 'Your summoning power is ' + inttostr(SmnPower[Killer]) + '/10!', Color) end;end;
if smnPower > 10 then SmnPower := 10;