Advertisement
DetonaSampOficial

[FILTERSCRIPT]Evento 1x1 Duelo

Jun 4th, 2016
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.33 KB | None | 0 0
  1.     /*
  2.     ARQUIVO BAIXADO NA DETONA SAMP
  3.         TUDO PARA SEU SERVIDOR SAMP
  4. WWW.detonasampoficial.blogspot.com.br
  5. */                                                                                                                                                                                                                                /*
  6.      ______________________________________________________________________
  7.     |                                                                      |
  8.     |                   Sistema idealizado e criado por:                   |
  9.     |                                                                      |
  10.     |       Jefrens: http://forum.sa-mp.com/member.php?u=254599            |
  11.     |                                                                      |
  12.     |       Hardware: http://forum.sa-mp.com/member.php?u=112804           |
  13.     |                                                                      |
  14.     |                 Não retire os créditos e não esqueça                 |
  15.     |                de colocar os créditos no seu servidor!               |
  16.     |______________________________________________________________________|
  17.                    Atualizado Data 29/11/2015                                                                                                                                                                                       */
  18.  
  19. /////////////////////////////////////////////////////////////////////////////////////
  20.  
  21. #define FILTERSCRIPT
  22.  
  23. #include <a_samp>
  24. #include <sscanf2>
  25. #include <zcmd>
  26.  
  27. #pragma tabsize 0
  28.  
  29. #if defined FILTERSCRIPT
  30.  
  31. // Callbacks
  32.  
  33. forward DescongelarJeff();
  34.  
  35. // Variaves
  36.  
  37. new id1,id2;
  38. new Tempox1 = 3;
  39. new TaNoX1[MAX_PLAYERS];
  40. new StrJEFF[256];
  41.  
  42. // Cores
  43.  
  44. #define COR_JEFF                0xFF0000FF
  45. #define COR_JEFF2               0xBFC0C2FF
  46. #define COR_JEFF3               0xFF0000AA
  47.  
  48. /////////////////////////////////////////////////////////////////////////////////////
  49.  
  50. public OnFilterScriptInit()
  51. {
  52.     print("\n----------------------------------------");
  53.     print(" Evento x1 By: Jefrens'Jeffao' e Hardware");
  54.     print("          Carregado com sucesso!");
  55.     print("-----------------------------------------\n");
  56.     return 1;
  57. }
  58.  
  59. public OnFilterScriptExit()
  60. {
  61.     print("\n----------------------------------------");
  62.     print(" Evento x1 By: Jefrens'Jeffao' e Hardware");
  63.     print("          Desligado com sucesso!");
  64.     print("-----------------------------------------\n");
  65.     return 1;
  66. }
  67.  
  68. CMD:x1(playerid,params[])
  69. {
  70.     if(sscanf(params,"dd",id1,id2)) return SendClientMessage(playerid,COR_JEFF2,"Uso: /x1 [id1] [id2]");
  71.     if(IsPlayerConnected(id1) == 0)
  72. {
  73.     SendClientMessage(playerid,COR_JEFF3,"[ERRO] Player ID1 não conectado!");
  74.     return 1;
  75. }
  76.     if(IsPlayerConnected(id2) == 0)
  77. {
  78.     SendClientMessage(playerid,COR_JEFF3,"[ERRO] Player ID2 não conectado!");
  79.     return 1;
  80. }
  81.     if(Tempox1 != 3)
  82. {
  83.     SendClientMessage(playerid, -1, "[ERRO] O X1 já começou espere acabar para começar outro!");
  84.     return 1;
  85. }
  86.     if(!IsPlayerAdmin(playerid))//if(PlayerInfo[playerid][pAdmin] < 3)
  87. {
  88.     SendClientMessage(playerid, COR_JEFF2, "Você não é um admin logado na RCON");
  89.     return 1;
  90. }
  91.     SetPlayerPos(id1, 1414.1641,-20.2892,1000.9251);// Seta id1 pra essa posição
  92.     SetPlayerPos(id2, 1362.8082,-20.4927,1000.9219);// Seta id2 pra essa posição
  93.     SetPlayerInterior(id1, 1);// Seta interior id1
  94.     SetPlayerInterior(id2, 1);// Seta interior id2
  95.     SetPlayerHealth(id1, 100);// Seta Vida id1
  96.     SetPlayerHealth(id2, 100);// Seta Vida id2
  97.     SetPlayerArmour(id1, 100);// Seta Colete id1
  98.     SetPlayerArmour(id2, 100);// Seta Colete id2
  99.     GivePlayerWeapon(id1, 24, 999);// Seta Desert id1
  100.     GivePlayerWeapon(id2, 24, 999);// Seta Desert id2
  101.     GivePlayerWeapon(id1, 25, 999);// Seta Shotgun id1
  102.     GivePlayerWeapon(id2, 25, 999);// Seta Shotgun id2
  103.     TaNoX1[id1] = 1;
  104.     TaNoX1[id2] = 1;
  105.     format(StrJEFF, sizeof(StrJEFF), "[Evento X1] {00FFFF}%s {FFFFFF}vs {00FFFF}%s", PlayerName(id1), PlayerName(id2));// Manda a mensagem
  106.     SendClientMessageToAll(COR_JEFF, StrJEFF);// Mensagem pra todos players online
  107.     TogglePlayerControllable(id1, 0);
  108.     TogglePlayerControllable(id2, 0);
  109.     DescongelarJeff();
  110.     return true;
  111. }
  112.  
  113. public OnPlayerDeath(playerid, killerid, reason)
  114. {
  115.     new string[256];
  116.     if(TaNoX1[playerid] == 1)
  117.         {
  118.         if(id1 == killerid)
  119.         {
  120.             format(string, sizeof(string), "[Evento X1] {00FFFF}%s {FFFFFF}Ganhou o x1 contra o {00FFFF}%s!", PlayerName(id1), PlayerName(id2));
  121.             SendClientMessageToAll(COR_JEFF, string);
  122.         }
  123.         else if(id2 == killerid)
  124.         {
  125.             format(string, sizeof(string), "[Evento X1] {00FFFF}%s {FFFFFF}Ganhou o x1 contra o {00FFFF}%s!", PlayerName(id2), PlayerName(id1));
  126.             SendClientMessageToAll(COR_JEFF, string);
  127.         }
  128.       TaNoX1[id1] = 0;
  129.       TaNoX1[id2] = 0;
  130.     }
  131. }
  132.  
  133. public DescongelarJeff()
  134. {
  135.         if(Tempox1 == 0)
  136.     {
  137.         format(StrJEFF, sizeof(StrJEFF),"%d", Tempox1);
  138.         GameTextForPlayer(id1,"~g~Go Go Go!", 1000, 6);
  139.         GameTextForPlayer(id2,"~g~Go Go Go!", 1000, 6);
  140.         Tempox1 = 3;
  141.             TogglePlayerControllable(id1, 1);
  142.                 TogglePlayerControllable(id2, 1);
  143.                 return 0;
  144.         }
  145.         format(StrJEFF, sizeof(StrJEFF),"%d", Tempox1);
  146.         GameTextForPlayer(id1, StrJEFF, 1000, 6);
  147.         GameTextForPlayer(id2, StrJEFF, 1000, 6);
  148.         SetTimer("DescongelarJeff", 1000, 0);
  149.         return Tempox1--;
  150. }
  151.  
  152. stock PlayerName(playerid)
  153. {
  154. new Name[MAX_PLAYER_NAME];
  155. GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
  156. return Name;
  157. }
  158.  
  159. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement