0 Members and 1 Guest are viewing this topic.
Function OnPlayerDamage(Victim,Shooter:Byte; Damage:Integer):Integer;begin Result := Damage; if (Soldier[Victim].Godmode) then begin Result := -99999; Exit; end; // Other stuff hereend:
type Stats=Record GodTime:Integer; end;var Soldier: Array[1..32] of Stats;Procedure OnJoinGame(ID,Team:Byte);begin Soldier[ID].GodTime := -1;end;Function OnPlayerCommand(ID:Byte; Text:String):Boolean;begin if (LowerCase(Copy(Text,1,4)) = '/god') then begin Soldier[ID].GodTime := 20; WriteConsole(ID,'You are invincible for 20 seconds!',$FFFFFF); end; Result := false;end;Function OnPlayerDamage(Victim,Shooter:Byte; Damage:Integer):Integer; begin Result := Damage; if (Soldier[Victim].GodTime <> -1) then begin Result := -99999; Exit; end; // Other stuff here end; Procedure AppOnIdle(Ticks:Integer);var i:Byte;begin for i := 1 to 32 do if (GetPlayerStat(i,'Active') = true) then if (Solder[i].GodTime <> -1) then begin Solder[i].GodTime := Soldier[i].GodTime - 1; if (Soldier[i].GodTime = 0) then begin Soldier[i].GodTime := -1; WriteConsole(i,'You are mortal again..',$CC0000); end;end;
if regExpMatch('^/(god|shield)$', Text) then beginif (soldier[ID].level >= 60) then beginsoldier[ID].GodTime :=20;WriteConsole(ID,'You are invincible for 20 seconds!',$FFFFFF);end else begin writeconsole(ID, 'You are not lvl 60 +', Color);end;Result := false;end;end;