0 Members and 2 Guests are viewing this topic.
- PunishBot (kicks spammers and bans them for x minutes (nearly finished)
procedure OnJoinTeam(ID,Team:Byte); begin if Team = 4 then begin Command('/setteam5 ' + ID); <<<- THIS LINE RETURNS THE ERROR WriteConsole(ID,'Do not try to join the mutants. Please choose an other faction!', Red); WriteConsole(ID,'To see which factions are available and other commands type !help', Red); end; end;
Next question: Why do I blame myself?
There's something weird with GiveBonusI'm using GiveBonus with OnPlayerRespawn procedure. I can't say it doesn't work - as the result I can see 'Berserker Mode', 'Cluster nades', 'Predator mode', but I don't get these bonuses actually...wtf?
Is OnJoinGame called before OnJoinTeam?
Procedure OnMapChange(NewMap: String);var PlaID: Integer; begin for PlaID := 1 to 32 do Spamming[PlaID] := 0; if Warning[PlaID] > 0 then begin Warning[PlaID] := 0; WriteConsole(PlaID,'Your warning level was reset', Green); end; end;
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.
PlaID has to be an array of integers or sth like that. Not just an integer.You didnt define Warning and Spamming.
He just forgot to put an begin in the loop.
OnMapChange();For PlaID := 1 To 32 Do if GetPlayerStat(PlaID,'Active') = True Then{ Statements }End;
var ShowDmg: Boolean;
Function OnPlayerDamage(Shooter,Victim:Byte; Damage:Integer): Integer;begin case GetPlayerStat(Shooter,'Human') of true: [...] false: [...] end; case GetPlayerStat(Victim,'Human') of true: [...] false: [...] end; if Player[Shooter].ShowDmg = true then WriteConsole(Shooter,'Output: ' + inttostr(Result), Red); if Player[Victim].ShowDmg = true then WriteConsole(Shooter,'Input: ' + inttostr(Result), Red);end;
Function OnCommand(ID:Byte; Text:String):boolean;var Piece1,Piece2,Piece3: String; Temp2,Temp3: Integer; begin Piece1 := GetPiece(Text,' ', 0); Piece2 := GetPiece(Text,' ', 1); Piece3 := GetPiece(Text,' ', 2); Temp2 := strtoint(Piece2); Temp3 := strtoint(Piece3); case Piece1 of '/showdmg': begin Player[ID].ShowDmg := not Player[ID].ShowDmg; WriteConsole(ID,'I/O messages got '+iif(Player[ID].ShowDmg=true,'enabled','disabled'),Black); end; [...] end;
Var ShowDmg: Boolean;Player[Shooter].ShowDmg; //This shouldn't work, because ShowDmg is a Global Variant, not an Array.//~~~~~~~~~~~~~~~~~~~~~~//To make that work, do this:Type DC = Record ShowDmg: Boolean;end;Var Player: Array[1..32] of DC;{ Statements } if Player[Shooter].ShowDmg = True; //Now we're talking about it!//~~~~~~~~~~~~~~~~~~~~~~~~//Although, if you are going to make only that Array, this should be faster and easier:Var ShowDmg: Array[1..32] of Boolean;{ Statements }if ShowDmg[Shooter] = True; //Faster, if you only have one Array.//Is a waste of time to create a Type Function for one Array.
Function GetTeamScore(Team: Byte): Integer; Var DC: Byte; Begin For DC := 1 To 32 Do if GetPlayerStat(DC,'Team') = Team Then Begin Result := GetPlayerStat(DC,'Flags'); end;end;//I'm sure you can come up with some Command that activates GetTeamScore() Function. :)//Good luck :D
function GetTeamScore(Team: byte): integer;begin case Team of 1: Result := AlphaScore; 2: Result := BravoScore; 3: Result := CharlieScore; 4: Result := DeltaScore; end;end;
case LowerCase(Piece1) of '/showdmg': begin Player[ID].ShowDmg := not Player[ID].ShowDmg; WriteConsole(ID, 'Damage displaying is now ' + iif(Player[ID].ShowDmg, 'enabled', 'disabled'), $FFFFFF); end; end;
if Player[Shooter].ShowDmg then WriteConsole(Shooter, 'Base Dmg: ' + inttostr(Damage) + ' Out: ' + inttostr(Result) + ' dmg.' Red); if Player[Victim].ShowDmg then WriteConsole(Victim, 'Base Dmg: ' + inttostr(Damage) + ' In: ' + inttostr(Result) + ' dmg.' Red);