Szerző Téma: [CODE] PlayerToPoint  (Megtekintve 988 alkalommal)

Nem elérhető Game94

  • 405
    • Profil megtekintése
[CODE] PlayerToPoint
« Dátum: 2011. December 30. - 17:01:35 »
0
Ezzel le tudjuk ellenõrizni hogy a játékos egy adott körön belül van-e
 
function PlayerToPoint(radi, playerid, x, y, z)
{
    if(isPlayerConnected(playerid))
{
local oldposx, oldposy, oldposz;
local tempposx, tempposy, tempposz;
local oldpos = getPlayerCoordinates(playerid);
tempposx = (oldpos[0] -x);
tempposy = (oldpos[1] -y);
tempposz = (oldpos[2] -z);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
   return 1;
}
}
return 0;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal