DETONASAMP

[FS] X1

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