AvdicKing

JBGA

Feb 24th, 2019
708
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. YCMD:stop(playerid,params[],help)
  2. {
  3. new string [ 100 ];
  4. format(string, sizeof(string), "[POLICIJA]: Policajac zahtjeva za stanete uz cestu!");
  5. ProxDetector(20.0, playerid, string, 0xE6E6E6E6, 0xE6E6E6E6, 0xE6E6E6E6, 0xE6E6E6E6, 0xE6E6E6E6);
  6. return true;
  7. }
  8. forward ProxDetector(Float:p_radi, playerid, string[],col1,col2,col3,col4,col5);
  9. public ProxDetector(Float:p_radi, playerid, string[],col1,col2,col3,col4,col5)
  10. {
  11. if(IsPlayerConnected(playerid))
  12. {
  13. new Float:posx, Float:posy, Float:posz;
  14. new Float:oldposx, Float:oldposy, Float:oldposz;
  15. new Float:tempposx, Float:tempposy, Float:tempposz;
  16. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  17. for(new i = 0; i < MAX_PLAYERS; i++)
  18. {
  19. if(IsPlayerConnected(i))
  20. {
  21. GetPlayerPos(i, posx, posy, posz);
  22. tempposx = (oldposx -posx);
  23. tempposy = (oldposy -posy);
  24. tempposz = (oldposz -posz);
  25. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  26. {
  27. if (((tempposx < p_radi/16) && (tempposx > -p_radi/16)) && ((tempposy < p_radi/16) && (tempposy > -p_radi/16)) && ((tempposz < p_radi/16) && (tempposz > -p_radi/16)))
  28. {
  29. SendClientMessage(i, col1, string);
  30. }
  31. else if (((tempposx < p_radi/8) && (tempposx > -p_radi/8)) && ((tempposy < p_radi/8) && (tempposy > -p_radi/8)) && ((tempposz < p_radi/8) && (tempposz > -p_radi/8)))
  32. {
  33. SendClientMessage(i, col2, string);
  34. }
  35. else if (((tempposx < p_radi/4) && (tempposx > -p_radi/4)) && ((tempposy < p_radi/4) && (tempposy > -p_radi/4)) && ((tempposz < p_radi/4) && (tempposz > -p_radi/4)))
  36. {
  37. SendClientMessage(i, col3, string);
  38. }
  39. else if (((tempposx < p_radi/2) && (tempposx > -p_radi/2)) && ((tempposy < p_radi/2) && (tempposy > -p_radi/2)) && ((tempposz < p_radi/2) && (tempposz > -p_radi/2)))
  40. {
  41. SendClientMessage(i, col4, string);
  42. }
  43. else if (((tempposx < p_radi) && (tempposx > -p_radi)) && ((tempposy < p_radi) && (tempposy > -p_radi)) && ((tempposz < p_radi) && (tempposz > -p_radi)))
  44. {
  45. SendClientMessage(i, col5, string);
  46. }
  47. }
  48. }
  49. }
  50. }
  51. return true;
  52. }
Add Comment
Please, Sign In to add comment