0 Members and 1 Guest are viewing this topic.
function WhereShot(Shoter, Victim: Byte; r: single): string;begin//Gora - Upif (GetPlayerStat(Shoter,'x')<=(GetPlayerStat(Victim,'x')+r)) and (GetPlayerStat(Shoter,'y')>GetPlayerStat(Victim,'y')) then Result := 'UP';if (GetPlayerStat(Shoter,'x')>=(GetPlayerStat(Victim,'x')-r)) and (GetPlayerStat(Shoter,'y')>GetPlayerStat(Victim,'y')) then Result := 'UP';//Dol - Downif (GetPlayerStat(Shoter,'x')<=(GetPlayerStat(Victim,'x')+r)) and (GetPlayerStat(Shoter,'y')<GetPlayerStat(Victim,'y')) then Result := 'DOWN';if (GetPlayerStat(Shoter,'x')>=(GetPlayerStat(Victim,'x')-r)) and (GetPlayerStat(Shoter,'y')<GetPlayerStat(Victim,'y')) then Result := 'DOWN';//Prawa - Rightif (GetPlayerStat(Shoter,'y')<=(GetPlayerStat(Victim,'y')+r)) and (GetPlayerStat(Shoter,'x')>GetPlayerStat(Victim,'x')) then Result := 'RIGHT';if (GetPlayerStat(Shoter,'y')>=(GetPlayerStat(Victim,'y')-r)) and (GetPlayerStat(Shoter,'x')>GetPlayerStat(Victim,'x')) then Result := 'RIGHT';//Lewa - Leftif (GetPlayerStat(Shoter,'y')<=(GetPlayerStat(Victim,'y')+r)) and (GetPlayerStat(Shoter,'x')<GetPlayerStat(Victim,'x')) then Result := 'LEFT';if (GetPlayerStat(Shoter,'y')>=(GetPlayerStat(Victim,'y')-r)) and (GetPlayerStat(Shoter,'x')<GetPlayerStat(Victim,'x')) then Result := 'LEFT';//Prawy gorny rog - Right upper cornerif (GetPlayerStat(Shoter,'x')>=(GetPlayerStat(Victim,'x')+r)) and (GetPlayerStat(Shoter,'y')>=(GetPlayerStat(Victim,'y')+r)) then Result := 'RIGHTUC';//Prawy dolny rog - Right bottom cornerif (GetPlayerStat(Shoter,'x')>=(GetPlayerStat(Victim,'x')+r)) and (GetPlayerStat(Shoter,'y')<=(GetPlayerStat(Victim,'y')-r)) then Result := 'RIGHTBC';//Lewy dolny rog - Left bottom cornerif (GetPlayerStat(Shoter,'x')<=(GetPlayerStat(Victim,'x')-r)) and (GetPlayerStat(Shoter,'y')<=(GetPlayerStat(Victim,'y')-r)) then Result := 'LEFTBC';//Lewy gorny rog - Left upper cornerif (GetPlayerStat(Shoter, 'x')<=(GetPlayerStat(Victim,'x')-r)) and (GetPlayerStat(Shoter,'y')>=(GetPlayerStat(Victim,'y')+r)) then Result := 'LEFTUC';end;
What I see application? I think the most interesting are BloodHUD (DrawText + my function). But I DID it that are needed to test the position of the text (characters: / | _).