0 Members and 2 Guests are viewing this topic.
var cap: boolean;function OnCommand(ID: Byte; Text: string): boolean;begin if Text='/capon' then begin DrawText(0,'Capping is Allowed!',300,RGB(255,255,255),0.15,40,240); Command('/say Capping is Allowed!'); cap :=true; end else if Text='/capoff' then begin DrawText(0,'Capping is NOT Allowed!',300,RGB(255,255,255),0.15,40,240); Command('/say Capping is NOT Allowed!'); cap :=false; end;end;procedure OnJoinGame(ID, Team: byte);begin if cap=false then begin DrawText(ID,'Capping is Not Allowed!',300,RGB(255,255,255),0.15,40,240); end else if cap=true then begin DrawText(ID,'Capping is Allowed!',300,RGB(255,255,255),0.15,40,240); end;end;procedure OnFlagGrab(ID, TeamFlag: byte;GrabbedInBase: boolean);begin if cap=false then begin // Uncomment the next line if you want players to die when they grab flag. // Command('/kill ' + inttostr(ID)); Command('/say Capping is BAD!'); Command('/say THAT MEANS YOU, ' + IDToName(ID) + '!'); End;End;procedure OnFlagScore(ID, TeamFlag: byte);begin if cap=false then begin Command('/kick ' + inttostr(ID)); Command('/say CAPPING NOT ALLOWED, GOOD RIDDANCE'); end;end;
procedure OnJoinGame(ID, Team: byte);begin if cap=false then begin DrawText(ID,'Capping is Not Allowed!',300,RGB(255,255,255),0.15,40,240); end else if cap=true then begin DrawText(ID,'Capping is Allowed!',300,RGB(255,255,255),0.15,40,240); end;end;
procedure OnJoinGame(ID, Team: byte);beginif cap=false then beginDrawText(ID,'Capping is Not Allowed!',300,RGB(255,255,255),0.15,40,240);end else if cap=true then beginDrawText(ID,'Capping is Allowed!',300,RGB(255,255,255),0.15,40,240);end;end;
procedure OnJoinGame(ID, Team: byte);beginif cap=false then DrawText(ID,'Capping is Not Allowed!',300,RGB(255,255,255),0.15,40,240)else DrawText(ID,'Capping is Allowed!',300,RGB(255,255,255),0.15,40,240);end;
Kicking the player on capping? That's a bid harsh...Hey DD, I got a good sciripting idea that I'm too lazy to do: No Cap Points - basically, when someone caps he doesn't get 20 points for it...
const CapPoints = 0;procedure OnFlagScore(ID, TeamFlag: byte);begin SetScore(ID,GetPlayerStat(ID,'Kills') + CapPoints - 20);end;
Out of curiosity, is their any difference between a constant and a variable, aside from constants having a fixed, unchangeable value?