Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.41 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define TEMPO 5 //TEMPO EM MINUTOS (TROCAR O "5")
  4.  
  5. new BigEar[MAX_PLAYERS];
  6.  
  7. public OnFilterScriptInit()
  8. {
  9. print("\n--------------------------------------");
  10. print(" FS by CidadeNovaRP ¬¬");
  11. print(" SAMP-VICIO ");
  12. print("--------------------------------------\n");
  13. return 1;
  14. }
  15.  
  16. public OnGameModeInit()
  17. {
  18. SetTimer("Ganhou", TEMPO*60000, true);
  19. return 1;
  20. }
  21.  
  22. forward Ganhou();
  23. public Ganhou()
  24. {
  25. new Players = 0;
  26. for(new i = 0; i < MAX_PLAYERS; i++)
  27. {
  28. if(IsPlayerConnected(i) && !IsPlayerNPC(i))
  29. {
  30. Players++;
  31. }
  32. }
  33. if(Players >= 15)
  34. {
  35. new PlayerWin = random(Players);
  36. if(!IsPlayerConnected(PlayerWin)) return Ganhou();
  37. new Moneys = 100 + random(1900);
  38. new PlayerName[64], string[128];
  39. GivePlayerMoney(PlayerWin, Moneys);
  40. GetPlayerName(PlayerWin, PlayerName, sizeof(PlayerName));
  41. format(string, sizeof(string), "* %s achou R$%d no chão.", PlayerName, Moneys);
  42. ProxDetector(30.0, PlayerWin, string, -1, -1, -1, -1, -1);
  43. return 1;
  44. }
  45. return 1;
  46. }
  47.  
  48. stock ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  49. {
  50. if(IsPlayerConnected(playerid))
  51. {
  52. new Float:posx, Float:posy, Float:posz;
  53. new Float:oldposx, Float:oldposy, Float:oldposz;
  54. new Float:tempposx, Float:tempposy, Float:tempposz;
  55. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  56. for(new i = 0; i < MAX_PLAYERS; i++)
  57. {
  58. if(IsPlayerConnected(i))
  59. {
  60. if(!BigEar[i])
  61. {
  62. GetPlayerPos(i, posx, posy, posz);
  63. tempposx = (oldposx -posx);
  64. tempposy = (oldposy -posy);
  65. tempposz = (oldposz -posz);
  66. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  67. {
  68. SendClientMessage(i, col1, string);
  69. }
  70. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  71. {
  72. SendClientMessage(i, col2, string);
  73. }
  74. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  75. {
  76. SendClientMessage(i, col3, string);
  77. }
  78. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  79. {
  80. SendClientMessage(i, col4, string);
  81. }
  82. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  83. {
  84. SendClientMessage(i, col5, string);
  85. }
  86. }
  87. else
  88. {
  89. SendClientMessage(i, col1, string);
  90. }
  91. }
  92. }
  93. }
  94. return true;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement