Advertisement
Chip7

[FS] Sistema de Achar Dinheiro no Chao

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