0 Members and 1 Guest are viewing this topic.
const Max_Players = 16;var s: array [1..Max_Players] of boolean;OnPlayerRespawn(id: byte);begin s[id]:=true;end;AppOnIdle(ticks: cardinal);var i: byte;begin for i:=1 to Max_Players do if s[ i] then begin s[ i]:=false; //GetPlayerXY, etc... end;end;
var AfterRespawn: array[1..32] of boolean;procedure OnPlayerRespawn(Id: byte);begin AfterRespawn[Id] := true;end;procedure AfterPlayerRespawn(Id: byte);begin // Whatever you wanted to doend;procedure AppOnIdle(Ticks: cardinal);var i: byte;begin for i := 1 to 32 do if (AfterRespawn[i]) then begin AfterRespawn[i] := false; if (GetPlayerStat(i, 'Active') = true) then AfterPlayerRespawn(i); end;end;procedure OnWeaponChange(Id, Primary, Secondary: byte);begin if (AfterRespawn[Id]) then begin AfterRespawn[Id] := false; AfterPlayerRespawn(Id); end;end;
Code: [Select]var AfterRespawn: array[1..32] of boolean;procedure OnPlayerRespawn(Id: byte);begin AfterRespawn[Id] := true;end;procedure AfterPlayerRespawn(Id: byte);begin // Whatever you wanted to doend;procedure AppOnIdle(Ticks: cardinal);var i: byte;begin for i := 1 to 32 do if (AfterRespawn[i]) then begin AfterRespawn[i] := false; if (GetPlayerStat(i, 'Active') = true) then AfterPlayerRespawn(i); end;end;procedure OnWeaponChange(Id, Primary, Secondary: byte);begin if (AfterRespawn[Id]) then begin AfterRespawn[Id] := false; AfterPlayerRespawn(Id); end;end;OnWeaponChange is called right after a player respawns, but just in case, you have AppOnIdle in there.
isn't that exactly what tk suggested? |:`