0 Members and 1 Guest are viewing this topic.
procedure OnPlayerSpeak(ID: Byte; Text: string);begin if Text = '!kill' then begin DoDamage(ID,4000);end;end;begin if Text = '!heal' then begin DoDamage(ID,-4000);end;end;
procedure OnPlayerSpeak(ID: Byte; Text: string);begin if Text = '!kill' then begin DoDamage(ID,4000); end; if Text = '!heal' then begin DoDamage(ID,-4000); end;end;
Ahh Fine thank you and another Question how can i do this Code Thing with the Script in it?
And now my Server is 9999PING too omfg! Now im at the End of My Live^^
function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/fireshield' then begin CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') 65, 0, 0,100, 5, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') - 65, 0, 0,100, 5, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') 0, - 65, 0,100, 5, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y') 0, 65, 0,100, 5, 1); end;end;
CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 65, 0, 100, 5, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 65, 0, 100, 5, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, - 65, 100, 5, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 65, 100, 5, 1);
Don't trust any of the examples on that page, figure them out yourself. Same goes for any of those functions really.
if Text = '/heal' then begin DoDamage(ID,-4000); end;
Thanks again. How can i add to this /heal script that i can write ID's which i want to heal like /heal 4 for Player4 i'm not sure but i think that is some with get Piece or so can u say me how? Code: [Select] if Text = '/heal' then begin DoDamage(ID,-4000); end;
if GetPiece(Text,' ',0) = '/heal' then begin DoDamage(strtoint(GetPiece(Text,' ',1)),-4000); end;
I don't have any result := true in it should i add it with false?
procedure OnPlayerCommand(ID: Byte; Text: string);begin if GetPiece(Text,' ',0) = '/heal' then begin DoDamage(strtoint(GetPiece(Text,' ',1)),-4000); end; if Text = '/boom' then begin DoDamage(ID,5000) CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, 0, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, 0, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 3, 6, 100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 3, -6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 3, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 3, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, 3, 100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, -3, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, - 3, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, 3, 100, 4, 0); end;end;
procedure OnPlayerCommand(ID: Byte; Text: string);begin if GetPiece(Text,' ',0) = '/heal' then begin DoDamage(strtoint(GetPiece(Text,' ',1)),-4000); end; if Text = '/boom' then begin DoDamage(ID,5000) CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, 0, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, 0, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 0, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 3, 6, 100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 3, -6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 3, - 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 3, 6, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, 3, 100, 4, 1); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, -3, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), 6, - 3, 100, 4, 0); CreateBullet(GetPlayerStat(ID,'x'), GetPlayerStat(ID,'y'), - 6, 3, 100, 4, 0); end; result := false;end;
procedure OnPlayerCommand(ID: Byte; Text: string);
function OnPlayerCommand(ID: Byte; Text: string): boolean;
procedure AppOnIdle(Ticks: integer);begin if Ticks mod (60 * 20) = 0 then begin if ?playername? givebonus(?,2); end; end;end;
procedure AppOnIdle(Ticks: integer);var i: integer; X, Y: single;begin if (Ticks mod (60 * 20) = 0) then begin for i:= 1 to 32 do begin if (IDToName(i) = 'xxx') then begin GetPlayerXY(i, X, Y); SpawnObject(X, Y, 21); end; end; end;end;
procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 20) = 0 then for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if GetPlayerStat(i, 'Name') = 'xxx' then SpawnObject(GetPlayerStat(i, 'X'), GetPlayerStat(i, 'Y'), 21);end;
procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 20) = 0 then for i := 1 to 32 do if GetPlayerStat(i, 'Active') then if IDToName(i) = 'xxx' then GiveBonus(i,2);end;
The best way to do it is using givebonus(id,style).style: pred: 1 bers: 2 vest: 3 nade: 4 cluster: 5Code: [Select]procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 20) = 0 then for i := 1 to 32 do if GetPlayerStat(i, 'Active') then if IDToName(i) = 'xxx' then GiveBonus(i,2);end;
Hmm, never saw that GiveBonus() function on enesce.com/help/ before, just wondering
procedure ActivateServer();var bsk: boolean;begin bsk:=false; WriteLn('Berserker Off');end;procedure AppOnIdle(Ticks: Integer);var i: Byte; bsk: boolean;begin if Ticks mod (60 * 10) = 0 then for i := 1 to 32 do if bsk=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);end;procedure OnPlayerRespawn(ID: byte);var i: Byte; bsk: boolean;begin for i := 1 to 32 do if bsk=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var bsk: boolean;begin if Text = '/bsk' then begin if bsk=false then begin bsk:=true; WriteLn('Berserker On'); end else begin bsk:=false; WriteLn('Berserker Off'); end; end; Result := false;end;
var bsk: boolean;procedure ActivateServer();begin bsk:=false; WriteLn('Berserker Off');end;procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 10) = 0 then for i := 1 to 32 do if bsk=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);end;procedure OnPlayerRespawn(ID: byte);var i: Byte;begin for i := 1 to 32 do if bsk=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/bsk' then begin if bsk=false then begin bsk:=true; WriteLn('Berserker On'); end else begin bsk:=false; WriteLn('Berserker Off'); end; end; Result := false;end;
var bsk: boolean; pre: boolean;procedure ActivateServer();begin bsk:=false; pre:=false;end;procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 10) = 0 then for i := 1 to 32 do if bsk=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);begin if Ticks mod (60 * 20) = 0 then for i := 1 to 32 do if pre=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,1);end;procedure OnPlayerRespawn(ID: byte);var i: Byte;begin for i := 1 to 32 do if bsk=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);begin for i := 1 to 32 do if pre=true then if GetPlayerStat(i, 'Active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,1);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/bsk' then begin if bsk=false then begin bsk:=true; end else begin bsk:=false; end; end;begin if Text = '/pre' then begin if pre=false then begin pre:=true; end else begin pre:=false; end; end; Result := false;end;
if bsk=true then ...;if bsk=false then ...;
if bsk then ...;if not bsk then ...;
for i := 1 to 32 do if bsk=true then ...;
if bsk then for i := 1 to 32 do ...;
3. Dealio with GetPlayerStat(i, 'active'). Unfortunately, for this one you have to add in = true, or it doesn't work out right.
var bsk: boolean; pre: boolean;procedure ActivateServer();begin not bsk; not pre;end;procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 10) = 0 then for i := 1 to 32 do if bsk then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);begin if Ticks mod (60 * 20) = 0 then for i := 1 to 32 do if pre then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,1);end;procedure OnPlayerRespawn(ID: byte);var i: Byte;begin for i := 1 to 32 do if bsk then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);begin for i := 1 to 32 do if pre=true then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,1);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/bsk' then begin if not bsk then begin bsk; end else begin not bsk; end; end;begin if Text = '/pre' then begin if not pre then begin pre:=true; end else begin not pre; end; end; Result := false;end;
procedure ActivateServer();begin bsk:=false; pre:=false;end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/bsk' then bsk := not bsk; if Text = '/pre' then pre := not pre;end;
if Text = '/pre' then pre := not pre;
pre := (1 > 0); // pre is truepre := not (5 = 5); // pre is falsepre := 'This' <> 'That'; // pre is true
var bsk: boolean; pre: boolean;procedure ActivateServer();begin bsk:=false; pre:=false;end;procedure AppOnIdle(Ticks: Integer);var i: Byte;begin if Ticks mod (60 * 10) = 0 then for i := 1 to 32 do if bsk then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);begin if Ticks mod (60 * 20) = 0 then for i := 1 to 32 do if pre then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,1);end;procedure OnPlayerRespawn(ID: byte);var i: Byte;begin for i := 1 to 32 do if bsk then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,2);begin for i := 1 to 32 do if pre=true then if GetPlayerStat(i, 'Alive') then if IDToName(i) = '-=]SH[=- y0uRd34th' then GiveBonus(i,1);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/bsk' then bsk := not bsk; if Text = '/pre' then pre := not pre;end;
var
if GetPlayerStat(i, 'Alive') then
var bsk: boolean; pre: boolean;procedure gb;var i: byte;begin for i := 1 to 32 do if getplayerstat(i,'active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then if bsk then GiveBonus(i,2) else if pre then GiveBonus(i,1);end;procedure AppOnIdle(Ticks: Integer);begin gb;end;procedure OnPlayerRespawn(ID: byte);beginvar gb;end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin case lowercase(Text) of '/bsk': bsk := true; '/bsk off': bsk := false; '/pre': pre := true; '/pre off': pre := false;end;
var bsk: boolean; pre: boolean;procedure gb;var i: byte;begin for i := 1 to 32 do if getplayerstat(i,'active') then if IDToName(i) = '-=]SH[=- y0uRd34th' then if bsk then GiveBonus(i,2) else if pre then GiveBonus(i,1);end;procedure AppOnIdle(Ticks: Integer);begin if Ticks mod (60 * 20) = 0 then gb;end;procedure OnPlayerRespawn(ID: byte);begin gb;end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin case lowercase(Text) of '/bsk': bsk := true; '/bsk off': bsk := false; '/pre': pre := true; '/pre off': pre := false; end;end;
var bos: boolean; okh: boolean;procedure OnFlagGrab(ID, TeamFlag: byte; GrabbedInBase: boolean);begin if bos then givebonus(ID,3);end;procedure OnFlagReturn(ID, TeamFlag: byte);begin if bos then givebonus(ID,4);end;procedure OnFlagScore(ID, TeamFlag: byte);begin if bos then givebonus(ID,5); givebonus(ID,2);end;procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin if okh then DoDamage(ID,-20);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin case lowercase(Text) of '/okh': hok := true; '/okh off': hok := false; '/bos': bos := true; '/bos off': bos := false; end; Result := false;end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin if okh then DoDamage(ID, -20);end;
procedure OnFlagScore(ID, TeamFlag: byte);begin if bos then givebonus(ID,5); givebonus(ID,2);end;
procedure OnPlayerKill(Killer, Victim: byte; Weapon: string);begin i := CreateBullet(GetPlayerStat(Victim,'x'), GetPlayerStat(Victim,'y'), 0, 0, 0,100, 2, Victim); ???I don't know how to let it Explode???end;
Hmm [ <> ] Can us say me the PlaceBot Thing? I've seen it a few days ago but don't find it again
thanks but omg bring me not much don't check this script lol can usay me Toumaz how to Explode M79 Bullets in the sky? without hiting Things or Walls etc. ? If not hmm then idk
Use createbullet to spawn it in the sky. It's impossible to make it explode in the sky (as far as I know). Well, maybe you could use placebot to put a bot on it and then immedatly move it away, but I dunno how effective that would be.
Yes,Yes EnEsCe, i know sry about Triple Post But do someone see it the "new" if i modify Post?
Quote from: y0uRd34th on December 28, 2008, 11:10:10 amYes,Yes EnEsCe, i know sry about Triple Post But do someone see it the "new" if i modify Post?A trick I use is to take the contents of my previous post, delete it, and then make a new post containing the previous post and my new post. Then you avoid double posting and you bump the topic.
procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do if Ticks mod (60 * 20) = 0 then givebonus(i,1);end;procedure OnPlayerRespawn(ID: byte);begin givebonus(ID,1); ForceWeapon(ID,13,14,0);end;procedure ActivateServer();var w: Byte;begin for w := 1 to 14 do SetWeaponActive(0,w,false);end;
var cooldown: array [1..32] of byte; just_resp: array [1..32] of boolean; procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do if getplayerstat(i,'active') then if cooldown[i] > 0 then cooldown[i] := cooldown[i] - 1 else begin givebonus(i,1); cooldown[i] := 20; if just_resp[i] then begin ForceWeapon(i,13,14,0); just_resp[i] := false; end; end;end;procedure OnPlayerRespawn(ID: byte);begin cooldown[id] := 1; just_resp[id] := true;end;procedure ActivateServer();var w: Byte;begin for w := 1 to 14 do SetWeaponActive(0,w,false);end;
procedure ActivateServer();var w: Byte;begin for w := 1 to 14 do SetWeaponActive(0,w,false);end;
procedure OnJoinGame(ID, Team: byte);var w: Bytebegin for w := 1 to 14 do SetWeaponActive(ID,w,false);end;
procedure OnJoinGame(ID, Team: byte);var w: Byte;begin for w := 1 to 14 do SetWeaponActive(ID,w,false);end;
procedure OnJoinGame(ID, Team: byte);var WeaponNum: Byte;begin for WeaponNum := 1 to 14 do SetWeaponActive(ID,WeaponNum,false);end;
var cooldown: array [1..32] of byte; coolbarret: array [1..32] of byte;procedure AppOnIdle(Ticks: integer);var i: Byte; u: Byte;begin for i := 1 to 32 do if getplayerstat(i,'active') then if cooldown[i] > 0 then cooldown[i] := cooldown[i] - 1 else begin givebonus(i,1); cooldown[i] := 20; end; for u := 1 to 32 do if GetPlayerStat(i,'active') then if coolbarret[u] > 0 then coolbarret[u] := cooldown[i] - 1end;procedure OnPlayerRespawn(ID: byte);begin cooldown[id] := 1;end;procedure OnJoinTeam(ID, Team: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false);end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);begin if PrimaryNum = 1 then ForceWeapon(ID,15,16,0);end;procedure OnFlagScore(ID, TeamFlag: byte);begin GiveBonus(ID,3);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/barret' then if coolbarret := 0 then begin ForceWeapon(ID,8,16,0); coolbarret[id] := 120; end; end; Result := false;end;
u: Byte; for u := 1 to 32 do if GetPlayerStat(i,'active') then if coolbarret[u] > 0 then coolbarret[u] := cooldown[i] - 1end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/barret' then if coolbarret := 0 then begin ForceWeapon(ID,8,16,0); coolbarret[id] := 120; end; end; Result := false;end;
coolbarret[u] := cooldown[i] - 1
coolbarret[i] := coolbarret[i] - 1
procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do if getplayerstat(i,'active') then begin if cooldown[i] > 0 then cooldown[i] := cooldown[i] - 1 else begin givebonus(i,1); cooldown[i] := 20; end; if coolbarret[i] > 0 then coolbarret[i] := coolbarret[i] - 1; end;end;end;
did you add global array coolbarret?
var cooldown: array [1..32] of byte; coolbarret: array [1..32] of byte;procedure AppOnIdle(Ticks: integer);var i: Byte; hp: integer;begin for i := 1 to 32 do if getplayerstat(i,'active') then begin if cooldown[i] > 0 then cooldown[i] := cooldown[i] - 1 else begin hp:=GetPlayerStat(i,'health'); GiveBonus(i,1); DoDamage(i,GetPlayerStat(i,'health')-hp); cooldown[i] := 20; end; -here i think its missing- if coolbarret[i] > 0 then coolbarret[i] := coolbarret[i] - 1; end;end;end;procedure OnPlayerRespawn(ID: byte);begin cooldown[id] := 1;end;procedure OnJoinTeam(ID, Team: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false);end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);begin if PrimaryNum = 1 then ForceWeapon(ID,15,16,0);end;procedure OnFlagScore(ID, TeamFlag: byte);begin GiveBonus(ID,3);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/barret' then if coolbarret := 0 then begin ForceWeapon(ID,8,16,0); coolbarret[id] := 120; end; Result := false;end;
but don't find the fail... ;/ There are 4ends and 3begins...
var cooldown: array [1..32] of byte; coolbarret: array [1..32] of byte;procedure AppOnIdle(Ticks: integer);var i: Byte; hp: integer;begin for i := 1 to 32 do if getplayerstat(i,'active') then begin if cooldown[i] > 0 then cooldown[i] := cooldown[i] - 1 else begin hp:=GetPlayerStat(i,'health'); GiveBonus(i,1); DoDamage(i,GetPlayerStat(i,'health')-hp); cooldown[i] := 20; end; if coolbarret[i] > 0 then coolbarret[i] := coolbarret[i] - 1; end;end;procedure OnPlayerRespawn(ID: byte);begin cooldown[id] := 1;end;procedure OnJoinTeam(ID, Team: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false);end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);begin if PrimaryNum = 1 then ForceWeapon(ID,15,16,0);end;procedure OnFlagScore(ID, TeamFlag: byte);begin GiveBonus(ID,3);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;begin if Text = '/barret' then if coolbarret := 0 then begin ForceWeapon(ID,8,16,0); //'THEN' expected? coolbarret[id] := 120; end; Result := false;end;
procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do if barret[i] > 0 then barret[i] := barret[i] - 60; if m79[i] > 0 then m79[i] := m79[i] - 60; if ammo[i] > 0 then ammo[i] := ammo[i] - 60;end;
procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do begin if barret[i] > 0 then barret[i] := barret[i] - 60; if m79[i] > 0 then m79[i] := m79[i] - 60; if ammo[i] > 0 then ammo[i] := ammo[i] - 60; end;end;
var barret: array [1..32] of byte; m79: array [1..32] of byte; ammo: array [1..32] of byte;procedure AppOnIdle(Ticks: integer);var i: Byte;begin for i := 1 to 32 do begin if barret[i] > 0 then barret[i] := barret[i] - 60; if m79[i] > 0 then m79[i] := m79[i] - 60; if ammo[i] > 0 then ammo[i] := ammo[i] - 60; end;end;procedure OnWeaponChange(ID, PrimaryNum, SecondaryNum: byte);begin if PrimaryNum = 1 then ForceWeapon(ID,15,16,0);end;procedure OnFlagScore(ID, TeamFlag: byte);begin GiveBonus(ID,3);end;function OnPlayerCommand(ID: Byte; Text: string): boolean;var pri,sec: integer;begin if Text = '/barret' then if barret[ID] = 0 then begin ForceWeapon(ID,8,16,0); barret[ID] := 7200; end if Text = '/m79' then if m79[ID] = 0 then begin ForceWeapon(ID,7,16,0); m79[ID] := 7200; end if Text = '/ammo' then if ammo[ID] = 0 then begin pri:=GetPlayerStat(ID,'Primary'); sec:=GetPlayerStat(ID,'Secondary'); ForceWeapon(ID,pri,sec,0); m79[ID] := 3000; end;Result := false;end;procedure OnJoinTeam(ID, Team: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false); barret[ID] := 0; m79[ID] := 0; ammo[ID] := 0;end;procedure OnPlayerRespawn(ID: byte);var w: Byte;begin for w := 2 to 14 do SetWeaponActive(ID,w,false);end;procedure OnPlayerSpeak(ID: Byte; Text: string);begin if Text = '!help' then begin SayToPlayer(ID,'"""""""""""""""""""""""""""""'); SayToPlayer(ID,'"Available Commands: "'); SayToPlayer(ID,'"/ammo | get full ammo "'); SayToPlayer(ID,'"/m79 | get M79 "'); SayToPlayer(ID,'"/barret | get Barret "'); SayToPlayer(ID,'"""""""""""""""""""""""""""""'); end;end;procedure ActivateServer();begin sleep(2000); Command('/loadwep snl');end;
procedure ActivateServer();begin sleep(2000); Command('/loadwep snl');end;
The best way would be to use OnPlayerDamage. Check if the Victim is a bot, and if so, lower the Result variable.
if Text = '/cluster' then begin if Player[ID].Cluster then begin Player[ID].Cluster := False; WriteConsole(ID,'Clusterdisabled!',$A10000); end else begin Player[ID].Cluster := True; WriteConsole(ID,'Cluster enabled!',$00A100); end; end; if Text = '/nades' then begin if Player[ID].Nades then begin Player[ID].Nades := False; WriteConsole(ID,'Nade disabled!',$A10000); end else begin Player[ID].Nades := True; WriteConsole(ID,'Nade enabled!',$00A100); end; end;
procedure AppOnIdle(Ticks: integer);var i, ID: Byte;begin for i := 1 to 32 do begin if PKnova[i] > 0 then PKnova[i] := PKnova[i] - 1; if Player[i].Cluster then Clusters(Player[i].Cluster,5); if Player[i].Nades then GiveBonus(Player[i].Nades,4); end;end;
if Player[i].Cluster then Clusters(Player[i].Cluster,5); if Player[i].Nades then GiveBonus(Player[i].Nades,4);
if Player[i].Cluster then GiveBonus(i,5); if Player[i].Nades then GiveBonus(i,4);
Quote from: iDante on January 05, 2009, 06:00:04 pmThe best way would be to use OnPlayerDamage. Check if the Victim is a bot, and if so, lower the Result variable.for example result := result/2then the bot will recive half of the damage that he should recive
GiveBonus(i,5);