Advertisement
ShomyScript

Untitled

Sep 30th, 2017
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | None | 0 0
  1. //=========================[ OOC SYSTEM SHOMY ]===============================//
  2.  
  3. //== [ INCLUDE ] ==//
  4.  
  5. #include <a_samp>
  6. #include <sscanf2>
  7. #include <zcmd>
  8. #include <foreach>
  9.  
  10. //== [ DEFINE ] ==//
  11.  
  12. #define COL_SERVER "{FF8000}"
  13. #define BELA "{FFFFFF}"
  14. #define BELA2 0xFFFFFFAA
  15.  
  16. //== [ STOCK ] ==//
  17.  
  18. stock GetName(playerid)
  19. {
  20. new name[MAX_PLAYER_NAME];
  21. GetPlayerName(playerid, name, sizeof(name));
  22. return name;
  23. }
  24.  
  25. //== [ PROX DETECTOR ] ==//
  26.  
  27. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  28. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  29. {
  30. if(IsPlayerConnected(playerid))
  31. {
  32. new Float:posx, Float:posy, Float:posz;
  33. new Float:oldposx, Float:oldposy, Float:oldposz;
  34. new Float:tempposx, Float:tempposy, Float:tempposz;
  35. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  36. foreach(Player,i)
  37. {
  38. if(IsPlayerConnected(i))
  39. {
  40. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  41. {
  42. GetPlayerPos(i, posx, posy, posz);
  43. tempposx = (oldposx -posx);
  44. tempposy = (oldposy -posy);
  45. tempposz = (oldposz -posz);
  46. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  47. {
  48. SendClientMessage(i, col1, string);
  49. }
  50. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  51. {
  52. SendClientMessage(i, col2, string);
  53. }
  54. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  55. {
  56. SendClientMessage(i, col3, string);
  57. }
  58. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  59. {
  60. SendClientMessage(i, col4, string);
  61. }
  62. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  63. {
  64. SendClientMessage(i, col5, string);
  65. }
  66. } }
  67. }
  68. }
  69. return 1;
  70. }
  71.  
  72. //== [ CMD ] ==//
  73.  
  74. CMD:b(playerid, params[])
  75. {
  76. new result[256],text;
  77. if(IsPlayerConnected(playerid))
  78. {
  79. if(sscanf(params, "s[100]",text )) return SendClientMessage(playerid, -1, ""COL_SERVER"[SERVER] "BELA"Koristite: /b (tekst)");
  80. format(result, sizeof(result), ""BELA"(( "COL_SERVER"OOC | "BELA"%s [ID %d]: %s ))", GetName(playerid),playerid, text);
  81. ProxDetector(20.0, playerid, result,BELA2,BELA2,BELA2,BELA2,BELA2);
  82. return 1;
  83. }
  84. return 1;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement