KaLu17

[pawno.pl] -> #29184

Nov 22nd, 2014
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.79 KB | None | 0 0
  1. public PlayerToPlayer(Float:radi, playerid, targetid)
  2. {
  3.         if(IsPlayerConnected(playerid) && IsPlayerConnected(targetid) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid))
  4.     {
  5.         new Float:posx, Float:posy, Float:posz;
  6.         new Float:oldposx, Float:oldposy, Float:oldposz;
  7.         new Float:tempposx, Float:tempposy, Float:tempposz;
  8.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  9.         //radi = 2.0; //Trigger Radius
  10.         GetPlayerPos(targetid, posx, posy, posz);
  11.         tempposx = (oldposx -posx);
  12.         tempposy = (oldposy -posy);
  13.         tempposz = (oldposz -posz);
  14.         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  15.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  16.         {
  17.             return 1;
  18.         }
  19.     }
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment