Advertisement
DarckWilly

[FILTERSCRIPT]ElectroTaser V1.0 By: DarckWilly

Jul 12th, 2013
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.13 KB | None | 0 0
  1. //--------------------------------------[IMPORTANTE]-----------------------------------------//
  2. //FILTERSCRIPT CRIADO POR DARCKWILLY
  3. //DIA/MÊS/ANO: 13-07-2013
  4. //FAVOR NÃO RETIRAR OS DEVIDOS CRÉDITOS
  5. //ESTÁS SOMENTE AUTORIZADO A RETIRAR OS CRÉDITOS DA LINHA 44
  6. //ALGUM BUG/PROBLEMA FAVOR CONTACTAR VIA FORUM-SAMP.
  7. //VERSÃO 1.0 FINAL
  8. //--------------------------------------------------------------------------------------------//
  9.  
  10. #include <a_samp>
  11. #include <zcmd>
  12.  
  13. #define SLOTS 50
  14. #define DIALOG_CREDITOS 6969
  15. #define FILTERSCRIPT
  16.  
  17. //----------BOOL'S------------//
  18. new bool:JogadorTaser[SLOTS] = false;
  19. new bool:Tased[SLOTS] = false;
  20. //----------------------------//
  21.  
  22. //---------FORWARD---------//
  23. forward UnTased(playerid);
  24. //-------------------------//
  25.  
  26. public OnFilterScriptInit()
  27. {
  28.     print("\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
  29.     print("*     [FilterScript] ElectroTaser [v1.0] Criado por: DarckWilly   *");
  30.     print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
  31.     return 1;
  32. }
  33.  
  34. public OnFilterScriptExit()
  35. {
  36.     print("\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*");
  37.     print("*     [FilterScript] ElectroTaser [v1.0] Criado por: DarckWilly   *");
  38.     print("*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\n");
  39.     return 1;
  40. }
  41.  
  42. public OnPlayerConnect(playerid)
  43. {
  44.     SendClientMessage(playerid, 0xFFCCFF00FF, "Sistema ElectroTaser [v1.0} criado por DarckWilly");
  45.     JogadorTaser[playerid] = false;
  46.     Tased[playerid] = false;
  47.     return 1;
  48. }
  49.  
  50. public OnPlayerDisconnect(playerid, reason)
  51. {
  52.     JogadorTaser[playerid] = false;
  53.     Tased[playerid] = false;
  54.     return 1;
  55. }
  56.  
  57. public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
  58. {
  59.     if(issuerid != INVALID_PLAYER_ID)
  60.     {
  61.         if(JogadorTaser[issuerid] == true && Tased[playerid] == false && GetPlayerWeapon(issuerid) == 0)
  62.         {
  63.             TogglePlayerControllable(playerid,0);
  64.             ApplyPlayerAnimation(issuerid,"KNIFE", "knife_3", 4.0, 0, 1, 0, 0, 1000);
  65.             ApplyPlayerAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  66.             new string[150];
  67.             new sstring[150];
  68.             format(string, 150, "{33CCFF}[INFO]: {FFFF99}Usaste o taser contra %s ,ele agora está paralizado durante 30 segundos.", pName(playerid));
  69.             SendClientMessage(issuerid, -1, string);
  70.             format(sstring, 150, "{33CCFF}[INFO]: {FFFF99}O admin %s usou o Taser contra ti, estás agora paralizado durante 30 segundos.", pNome(issuerid));
  71.             SendClientMessage(playerid, -1, sstring);
  72.             SetTimerEx("UnTased",  30000, 0, "i", playerid);
  73.             Tased[playerid] = true;
  74.         }
  75.     }
  76.     return 1;
  77. }
  78.  
  79. public UnTased(playerid)
  80. {
  81.     SendClientMessage(playerid, -1, "{33CCFF}[INFO]: {FFFF99}Acabou o tempo, voltaste ao normal.");
  82.     TogglePlayerControllable(playerid, 1);
  83.     ClearAnimations(playerid);
  84.     Tased[playerid] = false;
  85.     return 1;
  86. }
  87. //---------------STOCKS----------------//
  88. stock pName(playerid)
  89. {
  90.     new name[21];
  91.     GetPlayerName(playerid, name, 21);
  92.     return name;
  93. }
  94.  
  95. stock pNome(issuerid)
  96. {
  97.     new nome[21];
  98.     GetPlayerName(issuerid, nome, 21);
  99.     return nome;
  100. }
  101. stock ApplyPlayerAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)
  102. {
  103.     ApplyAnimation(playerid, animlib, "null", fDelta, loop, lockx, locky, freeze, time, forcesync);
  104.     return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
  105. }
  106.  
  107. //---------------STOCKS----------------//
  108.  
  109. //--------------COMANDO----------------//
  110.  
  111. CMD:taser(playerid)
  112. {
  113.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "{CC0000}[Erro]: {FFFF99}Não tens permissão para fazer este comando.");
  114.     {
  115.         if(JogadorTaser[playerid] == false)
  116.         {
  117.             if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{CC0000}[ERRO]: {FFFF99}Não podes usar o Taser dentro de um veiculo.");
  118.             {
  119.                 SendClientMessage(playerid, -1, "{33CCFF}[INFO]: {FFFF99}Estás agora com o Taser na mão.");
  120.                 SetPlayerAttachedObject(playerid, 0, 18642, 6, 0.06, 0.01, 0.08, 180.0, 0.0, 0.0);
  121.                 GameTextForPlayer(playerid, "Taser", 3000, 1);
  122.                 JogadorTaser[playerid] = true;
  123.                 return 1;
  124.             }
  125.         }
  126.         else
  127.         {
  128.                 SendClientMessage(playerid, -1, "{33CCFF}[INFO]: {FFFF99}Guardaste agora o Taser.");
  129.                 RemovePlayerAttachedObject(playerid, 0);
  130.                 JogadorTaser[playerid] = false;
  131.         }
  132.     }
  133.     return 1;
  134. }
  135.  
  136. CMD:tasercreditos(playerid)
  137. {
  138.     new string[150];
  139.     format(string, 128, "{CC0000}\n\n[FilterScript] {FFFF99}Electro{33CCFF}Taser {FFFFFF}criado por: {99FF00}DarckWilly{33CC00}\n\nTester: {99FF00}SILV3R F0X");
  140.     ShowPlayerDialog(playerid, DIALOG_CREDITOS, DIALOG_STYLE_MSGBOX, "{CC0000}[FILTERSCRIPT] {FFFF99}Créditos", string, "Ok", "");
  141.     return 1;
  142. }
  143. //--------------------------------------[IMPORTANTE]-----------------------------------------//
  144. //FILTERSCRIPT CRIADO POR DARCKWILLY
  145. //DIA/MÊS/ANO: 13-07-2013
  146. //FAVOR NÃO RETIRAR OS DEVIDOS CRÉDITOS
  147. //ESTÁS SOMENTE AUTORIZADO A RETIRAR OS CRÉDITOS DA LINHA 44
  148. //ALGUM BUG/PROBLEMA FAVOR CONTACTAR VIA FORUM-SAMP.
  149. //VERSÃO 1.0 FINAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement