Advertisement
Guest User

Sistema de x1

a guest
Jul 30th, 2011
1,247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.30 KB | None | 0 0
  1. //- FS criado por Bruno Pereira/DJ Bruninho. Porfavor não retire os creditos! - //
  2. //- Contato: brunopereiraa-@hotmail.com -//
  3. //- FS criado por Bruno Pereira/DJ Bruninho. Porfavor não retire os creditos! - //
  4.  
  5. //Includes
  6. #include <a_samp>
  7.  
  8. //Defines
  9. #define                 FILTERSCRIPT
  10. #if defined             FILTERSCRIPT
  11. #define MAXPLAYERS      100
  12. #define COR_CINZA       0xBFC0C2FF
  13. #define COR_AMARELO     0xF5DEB3AA
  14. #define COR_AZULZINHO   0x00A5FFFF
  15. #define COR_BRANCO      0xFAFAFAFF
  16. //NEWS
  17. new bool:Libero;
  18. new bool:TaX1[MAXPLAYERS];
  19. new Playersx1;
  20. new nome[MAX_PLAYER_NAME];
  21. new nome2[MAX_PLAYER_NAME];
  22.  
  23. //Public's
  24. public OnFilterScriptInit()
  25. {
  26.     Playersx1 = 0;
  27.     Libero = false;
  28.     print("||| x1 de 2 PESSOAS CARREGADO COM SUCESSO        |||");
  29.     print("||| By Bruno Pereira / DJ Bruninho               |||");
  30.     return 1;
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35.     print("||| x1 de 2 PESSOAS CARREGADO COM SUCESSO        |||");
  36.     print("||| By Bruno Pereira / DJ Bruninho               |||");
  37.  
  38.     return 1;
  39. }
  40. #endif
  41.  
  42. public OnPlayerCommandText(playerid, cmdtext[])
  43. {
  44.     new cmd[256], idx;
  45.     cmd = strtok(cmdtext, idx);
  46.     new string[128];
  47.     if(strcmp(cmd, "/irx1", true) == 0)
  48.     {
  49.         if(TaX1[playerid] == true)// Verifica se ele ja esta na arena!
  50.         {
  51.             SendClientMessage(playerid, COR_CINZA, " Você ja está na arena ");
  52.             return true;
  53.         }
  54.         if(!Libero)
  55.         {
  56.             SendClientMessage(playerid, COR_CINZA, " A arena esta fechada! ");
  57.             return true;
  58.         }
  59.         if(Playersx1 == 2)// Verifica se ja tem 2 pessoas na Arena!
  60.         {
  61.             SendClientMessage(playerid, COR_CINZA, " Ja tem 2 pessoas no x1 ");
  62.             return true;
  63.         }
  64.         SetPlayerPos(playerid, 1416.107000,0.268620,1000.926000);//- Seta ele pra essa posição.
  65.         Playersx1 ++;//-- Almenta o numero de players no x1!
  66.         TaX1[playerid] = true;//-- Define que o player ta no x1
  67.         GetPlayerName(playerid, nome, sizeof(nome));
  68.         format(string, sizeof(string),"O jogador %s foi para a arena de x1 quem quiser ir use /irx1", nome);
  69.         SendClientMessageToAll(COR_BRANCO,string);
  70.         SetPlayerInterior(playerid,1);//- Interior.
  71.         if(Playersx1 == 2)// Verifica se ja tem 2 pessoas na Arena!
  72.         {
  73.             format(string, sizeof(string)," A arena ja tem 2 jogadores, ninguem mais pode ir por inquanto! ");
  74.             SendClientMessage(playerid, COR_BRANCO,string);
  75.             return true;
  76.         }
  77.         return true;
  78.     }
  79.     if(strcmp(cmd, "/creditosx1", true) == 0)
  80.     {
  81.         SendClientMessage(playerid, COR_AMARELO, " Filter Script de X1 criado totalmente por Bruno Pereira/DJ Bruninho ");
  82.         SendClientMessage(playerid, COR_AMARELO, " Contato: brunopereiraa-@hotmail.com ");
  83.         return true;
  84.     }
  85.     if(strcmp(cmd, "/comandosx1", true) == 0)
  86.     {
  87.         SendClientMessage(playerid, COR_AMARELO, " /irx1 /playersx1 /statusx1 /creditosx1 ");
  88.         if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_AZULZINHO, " /liberarx1 /fecharx1 ");
  89.         return true;
  90.     }
  91.     if(strcmp(cmd, "/playersx1", true) == 0)
  92.     {
  93.         if(Playersx1 == 1)// Verifica se ja tem 2 pessoas na Arena!
  94.         {
  95.             SendClientMessage(playerid, COR_CINZA, " Tem uma pessoa no x1 ");
  96.             return true;
  97.         }
  98.         if(Playersx1 == 2)// Verifica se ja tem 2 pessoas na Arena!
  99.         {
  100.             SendClientMessage(playerid, COR_CINZA, " Tem 2 pessoas no x1 ");
  101.             return true;
  102.         }
  103.         return true;
  104.     }
  105.     if(strcmp(cmd,"/statusx1", true) ==0)
  106.     {
  107.         if(Libero)//-- Verifica se a arena esta liberada
  108.         {
  109.             SendClientMessage(playerid, COR_BRANCO, " A arena esta {7DE500}Aberta. ");
  110.         }
  111.         else
  112.         {
  113.             SendClientMessage(playerid, COR_BRANCO, " A arena esta {FF0000}Fechada. ");
  114.         }
  115.         return true;
  116.     }
  117.     if(strcmp(cmd, "/liberarx1", true) == 0)
  118.     {
  119.         if(!IsPlayerAdmin(playerid))//-- Verifica se o player é admin!
  120.         {
  121.             SendClientMessage(playerid, COR_CINZA, " Você não é admin ");
  122.             return true;
  123.         }
  124.         if(!Libero)// Verifica se a arena esta fechada!
  125.         {
  126.         Libero = true;// Define que a arena esta "Aberta".
  127.         GetPlayerName(playerid, nome, sizeof(nome));
  128.         format(string, sizeof(string)," O Admin %s liberou a arena com 2 vagas, use /irx1 ", nome);
  129.         SendClientMessageToAll(COR_AZULZINHO, string);
  130.         }
  131.         return true;
  132.     }
  133.     if(strcmp(cmd, "/fecharx1", true) == 0)
  134.     {
  135.         if(!IsPlayerAdmin(playerid))//-- Verifica se o player é admin!
  136.         {
  137.             SendClientMessage(playerid, COR_CINZA, " Você não é admin ");
  138.             return true;
  139.         }
  140.         if(Libero)// Verifica se a arena esta aberta!
  141.         {
  142.         Libero = false;// Define que a arena esta "fechada".
  143.         GetPlayerName(playerid, nome, sizeof(nome));
  144.         format(string, sizeof(string)," O Admin %s fechou a arena, ninguem mais pode ir. ", nome);
  145.         SendClientMessageToAll(COR_AZULZINHO, string);
  146.         }
  147.         return true;
  148.     }
  149.     return false;
  150. }
  151.  
  152. public OnPlayerDeath(playerid, killerid, reason)
  153. {
  154.     if(TaX1[playerid] == true)//-- Isso definira que essas funções abaixo só ocorrerão pra quem estiver na arena!
  155.     {
  156.         new string[128];
  157.         GetPlayerName(playerid, nome[playerid], 30);// -- Isso ira verificar o nome do playerr que morreu no x1 !
  158.         GetPlayerName(killerid, nome2[killerid], 29);// -- Isso ira verificar o nome do player que matou no x1 !!
  159.         TaX1[playerid] = false;//-- Define que o player não esta mais no x1!
  160.         TaX1[killerid] = false;//-- Define que o player não esta mais no x1!
  161.         SpawnPlayer(killerid);//-- Seta o o matador.
  162.         Playersx1 = 0; //-- Seta o numero de pessoas no x1 pra 0
  163.         Libero = false;// Fecha a arena.
  164.         format(string, sizeof(string), "[x1-INFO] %s matou o %s no x1 parabéns pra ele!", nome2,  nome);// Manda a mensagem!
  165.         SendClientMessageToAll(COR_AMARELO, string);// Mensagem pra todos players online!
  166.     }
  167.     return true;
  168. }
  169.  
  170. strtok(const string[], &index)
  171. {
  172.     new length = strlen(string);
  173.     while ((index < length) && (string[index] <= ' '))
  174.     {
  175.         index++;
  176.     }
  177.  
  178.     new offset = index;
  179.     new result[20];
  180.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  181.     {
  182.         result[index - offset] = string[index];
  183.         index++;
  184.     }
  185.     result[index - offset] = EOS;
  186.     return result;
  187. }
  188. //- FS criado por Bruno Pereira/DJ Bruninho. Porfavor não retire os creditos! - //
  189. //- Contato: brunopereiraa-@hotmail.com -//
  190. //- FS criado por Bruno Pereira/DJ Bruninho. Porfavor não retire os creditos! - //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement