Advertisement
Guest User

Untitled

a guest
Aug 16th, 2023
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. function ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5) {
  2. new Float:posx, Float:posy, Float:posz;
  3. new Float:oldposx, Float:oldposy, Float:oldposz;
  4. new Float:tempposx, Float:tempposy, Float:tempposz;
  5. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  6. foreach(new i : Player) {
  7. if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)) {
  8. if(!BigEar[i]) {
  9. GetPlayerPos(i, posx, posy, posz);
  10. tempposx = (oldposx -posx);
  11. tempposy = (oldposy -posy);
  12. tempposz = (oldposz -posz);
  13. if(((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16))) {
  14. SendClientMessage(i, col1, string); }
  15. else if(((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8))) {
  16. SendClientMessage(i, col2, string); }
  17. else if(((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4))) {
  18. SendClientMessage(i, col3, string); }
  19. else if(((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2))) {
  20. SendClientMessage(i, col4, string); }
  21. else if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi))) {
  22. SendClientMessage(i, col5, string); }
  23. }
  24. else SendClientMessage(i, col1, string);
  25. }
  26. }
  27. return 1;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement