0 Members and 1 Guest are viewing this topic.
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