0 Members and 1 Guest are viewing this topic.
var Invisible: array[1..32] of boolean;function OnCommand(ID: Byte; Text: string): boolean;begin Result := false; if Text = '/invis' then if Invisible[ID] then begin  WriteConsole(ID,'Invisibility has been disabled.',$FFFFFFFF);  Invisible[ID] := false; end else begin  WriteConsole(ID,'Invisibility has been enabled.',$FFFFFFFF);  Invisible[ID] := true; end;begin if Invisible[ID] then GiveBonus(ID, 1); end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Invisible[ID] := false;end;
Procedure AppOnIdle(Ticks: integer);beginif Ticks mod (60 * 25) = 0 then begin //code you wanna repeat every 25 secs (predator tme) end;end;
Sorry but none of those really helped.The GiveBonus I have up there is undocumented but does the same thing as the spawnobject.DorkeyDearCurt, read more carefully next time.Invisibility...Yeah...anyway I think I know how to do it, you can make it repeat the Givebonus every like 20 or 30 seconds depending on how long predator usually lasts and then the existing code would make it stop repeating it and you would just have to wait for your existing predator to stop? I just don't know how to make something repeat like every so many seconds.
var Invisible: array[1..32] of boolean;function OnCommand(ID: Byte; Text: string): boolean;begin Result := false; if Text = '/invis' then if Invisible[ID] then begin WriteConsole(ID,'Invisibility has been disabled.',$FFFFFFFF); Invisible[ID] := false; end else begin WriteConsole(ID,'Invisibility has been enabled.',$FFFFFFFF); Invisible[ID] := true; GiveBonus(ID, 1); end;end;Procedure AppOnIdle(ID, Ticks: integer);beginif Ticks mod (60 * 25) = 0 then beginif Invisible[ID] = true end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Invisible[ID] := false;end;
So I have this?Code: [Select]var Invisible: array[1..32] of boolean;function OnCommand(ID: Byte; Text: string): boolean;begin Result := false; if Text = '/invis' then if Invisible[ID] then begin WriteConsole(ID,'Invisibility has been disabled.',$FFFFFFFF); Invisible[ID] := false; end else begin WriteConsole(ID,'Invisibility has been enabled.',$FFFFFFFF); Invisible[ID] := true; GiveBonus(ID, 1); end;end;Procedure AppOnIdle(ID, Ticks: integer);beginif Ticks mod (60 * 25) = 0 then beginif Invisible[ID] = true then beginGiveBonus(ID,1); //dunno if this will workend;end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Invisible[ID] := false;end;
var Invisible: array[1..32] of boolean;function OnCommand(ID: Byte; Text: string): boolean;begin Result := false; if Text = '/invis' then if Invisible[ID] then begin WriteConsole(ID,'Invisibility has been disabled.',$FFFFFFFF); Invisible[ID] := false; end else begin WriteConsole(ID,'Invisibility has been enabled.',$FFFFFFFF); Invisible[ID] := true; GiveBonus(ID, 1); end;end;Procedure AppOnIdle(ID, Ticks: integer);beginif Ticks mod (60 * 25) = 0 then beginif Invisible[ID] = true then beginGiveBonus(ID,1); //dunno if this will workend;end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Invisible[ID] := false;end;
procedure AppOnIdle(Ticks: integer);var Counter: Byte;begin if Ticks mod (60 * 25) = 0 then begin for Counter := 1 to 32 do // run through all the players if Invisible[Counter] = true then begin // and do this for them GiveBonus(Counter, 1); //dunno if this will work end; end;end;
you must check if the ID is an admin
So I have this?Code: [Select]var Invisible: array[1..32] of boolean;function OnCommand(ID: Byte; Text: string): boolean;begin Result := false; if Text = '/invis' then if Invisible[ID] then begin WriteConsole(ID,'Invisibility has been disabled.',$FFFFFFFF); Invisible[ID] := false; end else begin WriteConsole(ID,'Invisibility has been enabled.',$FFFFFFFF); Invisible[ID] := true; GiveBonus(ID, 1); end;end;Procedure AppOnIdle(ID, Ticks: integer);beginif Ticks mod (60 * 25) = 0 then beginif Invisible[ID] = true end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Invisible[ID] := false;end;
Quote from: KwS Pall on December 19, 2007, 04:11:33 pmyou must check if the ID is an adminOnCommands apply only to adminsDate Posted: December 19, 2007, 05:10:26 pmQuote from: Gnintendo on December 19, 2007, 04:02:29 pmSo I have this?Code: [Select]var Invisible: array[1..32] of boolean;function OnCommand(ID: Byte; Text: string): boolean;begin Result := false; if Text = '/invis' then if Invisible[ID] then begin WriteConsole(ID,'Invisibility has been disabled.',$FFFFFFFF); Invisible[ID] := false; end else begin WriteConsole(ID,'Invisibility has been enabled.',$FFFFFFFF); Invisible[ID] := true; GiveBonus(ID, 1); end;end;Procedure AppOnIdle(ID, Ticks: integer);beginif Ticks mod (60 * 25) = 0 then beginif Invisible[ID] = true end;end;procedure OnLeaveGame(ID, Team: byte; Kicked: boolean);begin Invisible[ID] := false;end;Your apponidle procedure is wrong. You do a if with no then and you have to use something like :for i:= 1 to 32 do // that s to check all the characters if Invisible then // same as if Invisible[ID] = true then GiveBonus(i,1); // never used Givebonus and did't test it, i just retake your syntax hereAlso, to be clear, you should let a space between the different stuff in the code :after the global vars (the Invisible array) and after the functions and procedures