0 Members and 1 Guest are viewing this topic.
function GetPlayerStat(ID: byte; Stat: string): Variant;begin if (ID > 32) or (ID < 1) then exit; Stat := uppercase(Stat); if Stat = 'KILLS' then result := Sprite[ID].Player.Kills; //Integer if Stat = 'DEATHS' then result := Sprite[ID].Player.Deaths; //Integer if Stat = 'PING' then result := Sprite[ID].Player.PingTime; //Integer if Stat = 'TEAM' then result := Sprite[ID].Player.Team; //Byte if Stat = 'ACTIVE' then result := Sprite[ID].Active; //Boolean if Stat = 'IP' then result := Sprite[ID].Player.IP; //String if Stat = 'NAME' then result := Sprite[ID].Player.Name; //String if Stat = 'ALIVE' then result := iif(Sprite[ID].DeadMeat = true, false, true); //Boolean if Stat = 'HEALTH' then result := Sprite[ID].Health; //Integer if Stat = 'PRIMARY' then result := Sprite[ID].Weapon.Num; //Byte if Stat = 'SECONDARY' then result := Sprite[ID].SecondaryWeapon.Num; //Byte if Stat = 'AMMO' then result := Sprite[ID].Weapon.AmmoCount; //Byte if Stat = 'JETS' then result := Sprite[ID].JetsCount; //Integer if Stat = 'GRENADES' then result := Sprite[ID].GrenadeCount; //Byte if Stat = 'X' then result := Sprite[ID].Skeleton.Pos[1].x; //Single if Stat = 'Y' then result := Sprite[ID].Skeleton.Pos[1].y; //Single if Stat = 'FLAGGER' then result := iif((Sprite[ID].HoldedThing > 0) and (Thing[Sprite[ID].HoldedThing].Style < 4), true, false); //Boolean if Stat = 'TIME' then result := Sprite[ID].Player.PlayTime; //Integer if Stat = 'GROUND' then result := Sprite[ID].OnGround; //Boolean if Stat = 'HUMAN' then result := iif(Sprite[ID].Player.ControlMethod = HUMAN, true, false); //Boolean if Stat = 'VELX' then result := SpriteParts.Velocity[ID].x; //Single if Stat = 'VELY' then result := SpriteParts.Velocity[ID].y; //Single if Stat = 'VEST' then result := Sprite[ID].Vest; //Integer if Stat = 'TIME' then result := Sprite[ID].Player.PlayTime; //Integer if Stat = 'DIRECTION' then result := iif(Sprite[ID].Direction = -1, '<', '>'); //Charend;
Fix dynamic array instability
Currently it is infeasible to have your source in multiple files because the line numbers given in errors are cumulative over all files rather than per-file, making it very cumbersome to debug.