Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function Float:DistanceToPlayer(playerid, targetid) {
  2. new Float: Pos[3], Float: distance;
  3. GetPlayerPos(targetid, Pos[0], Pos[1], Pos[2]);
  4. distance = GetPlayerDistanceFromPoint(playerid, Pos[0], Pos[1], Pos[2]);
  5. return distance;
  6. }
  7.  
  8. function Float:GetDistanceBetweenPlayers(p1,p2) {
  9. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  10. if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2)) return -1.00;
  11. GetPlayerPos(p1,x1,y1,z1);
  12. GetPlayerPos(p2,x2,y2,z2);
  13. return floatsqroot(floatpower(floatabs(floatsub(x2,x1)),2)+floatpower(floatabs(floatsub(y2,y1)),2)+floatpower(floatabs(floatsub(z2,z1)),2));
  14. }
  15.  
  16. Folosesc Gamemode Burned.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement