0 Members and 1 Guest are viewing this topic.
it's dont work. i wrote in cmd /setpred 1 (1 is my ID, i wrote this in game), and nothing happens ;f before when i start my server i edit file commands.txt in folder Master and i wrote command setpred and its sucks, dont work.
Sorry, but your script won't work for me. I wrote "/setpred 1" in Soldat's cmd, but nothing happens. Bevore I started my server I edited the commands.txt file in the script's directory. Can you fix this problem, please?
CrossFunc([ID, MasterCmds[i]], 'InfiPred.OnCommand'); Break;
CrossFunc([ID, Text], 'InfiPred.OnCommand');Break;
const Color = $FFFFFFFF;var IsPred, AfterRespawn: array[1..32] of boolean;procedure AppOnIdle(Ticks: cardinal);var i: byte;begin for i := 1 to 32 do if AfterRespawn[i] then begin if IsPred[i] then begin GiveBonus(i, 1); DrawText(i, ' ', 0, $00000000, 0, 0, 0); end; AfterRespawn[i] := false; end; if (Ticks mod 600) = 0 then begin for i := 1 to 32 do if GetPlayerStat(i, 'Active') = true then if IsPred[i] and (GetPlayerStat(i, 'Alive') = true) then begin GiveBonus(i, 1); DrawText(i, ' ', 0, $00000000, 0, 0, 0); end; end;end;procedure OnJoinGame(Id, Team: byte);begin IsPred[Id] := false;end;function OnCommand(Id: byte; Text: string): boolean;var Who: byte;begin if Text[1] = '/' then begin Delete(Text, 1, 1); if LowerCase(GetPiece(Text, ' ', 0)) = 'setpred' then begin try Who := StrtoInt(Copy(Text, 9, Length(Text))); if not GetPlayerStat(Who, 'Active') then StrtoInt(' '); IsPred[Who] := true; if GetPlayerStat(Who, 'Alive') = true then begin GiveBonus(Who, 1); DrawText(Who, ' ', 0, $00000000, 0, 0, 0); end; if Id <> Who then WriteConsole(Id, 'You have given ' + GetPlayerStat(Who, 'Name') + ' infinite predator', Color); WriteConsole(Who, 'An admin has given you infinite predator', Color); except WriteConsole(Id, 'Invalid player', Color); end; end else if LowerCase(GetPiece(Text, ' ', 0)) = 'delpred' then begin try Who := StrtoInt(Copy(Text, 9, Length(Text))); if not GetPlayerStat(Who, 'Active') then StrtoInt(' '); IsPred[Who] := false; if Id <> Who then WriteConsole(Id, 'You have taken infinite predator from ' + GetPlayerStat(Who, 'Name'), Color); WriteConsole(Who, 'An admin has taken your infinite predator', Color); except WriteConsole(Id, 'Invalid player', Color); end; end; end;end;procedure OnPlayerRespawn(Id: byte);begin AfterRespawn[Id] := true;end;