Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. stock IsPlayerNearPlayer(playerid, nearplayerid, Float:maxdis)
  2. {
  3. new Float:pos[6];
  4. GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
  5. GetPlayerPos(nearplayerid, pos[3], pos[4], pos[5]);
  6. if (pos[0] >= floatsub(pos[3], maxdis) && pos[0] <= floatadd(pos[3], maxdis)
  7. && pos[1] >= floatsub(pos[4], maxdis) && pos[1] <= floatadd(pos[4], maxdis)
  8. && pos[2] >= floatsub(pos[5], maxdis) && pos[2] <= floatadd(pos[5], maxdis))
  9. {
  10. return 1;
  11. }
  12. return 0;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement