LeonardoBradoks

Ajudando Membro Sistema de UP Premiado Randômico

Mar 7th, 2018
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.63 KB | None | 0 0
  1. /*
  2. ◄ Leonardo Bradoks
  3. ◄ 07/03/2018 - https://youtu.be/1GeRH5YwAYk
  4. */
  5.  
  6.  
  7. #include <a_samp>
  8. #include <dini>
  9.  
  10. #define PASTA_CONTAS "Contas/%s.ini"
  11.  
  12. new bool:RoletaAtiva[MAX_PLAYERS];
  13.  
  14. forward UP();
  15. forward UPPlayer(playerid);   /*-- MOMENTO EM QUE BUGOU MEU CÉREBRO POR NÃO UTILIZAR MAIS FORWARD E SIM FUNCTION --*/
  16.  
  17. main()
  18. {
  19.     print("\n----------------------------------");
  20.     print(" Blank Gamemode by your name here");
  21.     print("----------------------------------\n");
  22. }
  23.  
  24. public OnGameModeInit()
  25. {
  26.     SetTimer("UP", 60000, true); /*-- SE O UP FOR O MESMO TEMPO PARA TODOS OS PLAYERS --*/
  27.     return 1;
  28. }
  29.  
  30. public OnPlayerSpawn(playerid)
  31. {
  32.     SetTimerEx("UPPlayer", 60000, true, "d", playerid); /*-- SE O UP FOR POR TEMPO DIFERENTE DE CADA JOGADOR, POR TEMPO CONECTADO --*/
  33.     return 1;
  34. }
  35.  
  36. public UP() { /*-- SE O UP FOR O MESMO TEMPO PARA TODOS OS PLAYERS --*/
  37.     for(new i = 0; i < GetMaxPlayers(); i++) {
  38.         if(IsPlayerConnected(i)) {
  39.             RoletaAtiva[i] = true;
  40.             SendClientMessage(i, 0x00FF00AA, "[ UP ] Parabéns você acabou de passar por mais um UP, aproveite e tente a sorte use: /roletar");
  41.         }
  42.     }
  43.     return 1;
  44. }
  45.  
  46. public UPPlayer(playerid) { /*-- SE O UP FOR POR TEMPO DIFERENTE DE CADA JOGADOR, POR TEMPO CONECTADO --*/
  47.     if(IsPlayerConnected(playerid)) {
  48.         RoletaAtiva[playerid] = true;
  49.         SendClientMessage(playerid, 0x00FF00AA, "[ UP ] Parabéns você acabou de passar por mais um UP, aproveite e tente a sorte use: /roletar");
  50.     }
  51.     return 1;
  52. }
  53.  
  54.  
  55. public OnPlayerCommandText(playerid, cmdtext[])
  56. {
  57.     if(strcmp(cmdtext, "/roletar", true) == 0) {
  58.         if(RoletaAtiva[playerid] == false) return SendClientMessage(playerid, -1, "[ ROLETA ] Ainda não está disponível para roletar ! aguarde o próximo UP");
  59.         RoletaAtiva[playerid] = false;
  60.         new file[50], bradoks[MAX_PLAYER_NAME], PremioRandom = random(10);
  61.         GetPlayerName(playerid, bradoks, sizeof(bradoks));
  62.         format(file, sizeof(file), PASTA_CONTAS, bradoks);
  63.         switch(PremioRandom) {
  64.             case 0: {
  65.                 SendClientMessage(playerid, -1, "[ ROLETA ] {FF0000}Que pena não foi desta vez !");
  66.             }
  67.             case 1: { /*-- Celular --*/
  68.                 dini_IntSet(file, "Celular", 1);
  69.                 dini_IntSet(file,"Celoff", 1);
  70.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Celular!");
  71.             }
  72.             case 2: { /*-- MP3 --*/
  73.                 dini_IntSet(file, "MP3", 1);
  74.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um MP3!");
  75.             }
  76.             case 3: { /*-- Velocimetro --*/
  77.                 dini_IntSet(file,"Velocimetro", 1);
  78.                 dini_IntSet(file,"VelocimetroOn", 1);
  79.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Velocimetro!");
  80.             }
  81.             case 4: { /*-- GPS --*/
  82.                 dini_IntSet(file, "Gps", 1);
  83.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um GPS!");
  84.             }
  85.             case 5: { /*-- Bloco de Notas --*/
  86.                 dini_IntSet(file, "Bloco", 1);
  87.                 dini_Set(file, "Lembrete", "Nada");
  88.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Bloco de Notas!");
  89.             }
  90.             case 6: { /*-- Capacete --*/
  91.                 dini_IntSet(file,"Capacete", 1);
  92.                 dini_IntSet(file,"CapaceteOn", 0);
  93.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Capacete!");
  94.             }
  95.             case 7: { /*-- Jetpack --*/
  96.                 dini_IntSet(file,"jetpack", 1);
  97.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um JetPack!");
  98.             }
  99.             case 8: { /*-- Sem Parar --*/
  100.                 dini_IntSet(file,"semparar", 1);
  101.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Sem Parar!");
  102.             }
  103.             case 9: { /*-- Laser --*/
  104.                 dini_IntSet(file,"Laser", 1);
  105.                 dini_IntSet(file,"LaserOn", 0);
  106.                 dini_IntSet(file,"LaserCor", 18643);
  107.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Laser!");
  108.             }
  109.             case 10: { /*-- Neon --*/
  110.                 dini_IntSet(file,"kitneon", 1);
  111.                 SendClientMessage(playerid, 0x00FFFFAA, "[ ROLETA ] Parabéns você ganhou um Kit Neon!");
  112.             }
  113.         }
  114.         return 1;
  115.     }
  116.     return 0;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment