Advertisement
Guest User

[FS]Sistema de Drogas

a guest
Nov 12th, 2010
416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 7.67 KB | None | 0 0
  1. #define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <dudb>
  5. #include <dini>
  6.  
  7. #define DIALOG_DROGAS 230
  8. #define DIALOG_QUANTIAM 231
  9. #define DIALOG_QUANTIAC 232
  10. #define DIALOG_QUANTIACC 233
  11. #define DIALOG_ESCOLHERDROGAS 234
  12.  
  13. #pragma tabsize 0
  14.  
  15. #define Amarelo                                                                 0xFFFF00FF
  16. #define Vermelho                                                                0xAA3333AA
  17. #define Branco                                                                  0xFFFFFFAA
  18. #define Verde                                                                   0x33AA33AA
  19. #define Preto                                                                   0x00000000
  20. #define Azul                                                                    0x33CCFFAA
  21. #define Violeta                                                                 0x9955DEEE
  22. #define Cinza                                                                   0xAFAFAFAA
  23. #define COLOR_GREEN                                                             0x33AA33AA
  24. #define COLOR_RED                                                               0xAA3333AA
  25. #define COLOR_WHITE                                                             0xFFFFFFAA
  26.  
  27.  
  28. new pMaconha[MAX_PLAYERS];
  29. new pCrack[MAX_PLAYERS];
  30. new pCocaina[MAX_PLAYERS];
  31.  
  32. forward FicarNormal(playerid);
  33.  
  34. new PickupMorroLS;
  35.  
  36. //forward FumandoMaconha(playerid);
  37. //forward FumandoCrack(playerid);
  38. //forward CheirandoCocaína(playerid);
  39.  
  40. public OnFilterScriptInit()
  41. {
  42.     print("\n======================================");
  43.     print(" Sistema de Drogas bY RaFaeL[DL](faeldk)");
  44.     print("======================================\n");
  45.  PickupMorroLS = CreatePickup(1279, 1, 2176.8103,-984.8187,64.4688);
  46.  Create3DTextLabel("Boca de Drogas [LS]",0xFFFF00AA,2176.8103,-984.8187,64.4688,50.0,0,0);
  47.     return 1;
  48. }
  49.  
  50. public OnFilterScriptExit()
  51. {
  52.     return 1;
  53. }
  54.  
  55.  
  56. main()
  57. {
  58.     print("\n======================================");
  59.     print(" Sistema de Drogas bY RaFaeL[DL](faeldk)");
  60.     print("======================================\n");
  61. }
  62.  
  63.  
  64. public OnPlayerConnect(playerid)
  65. {
  66. pMaconha[playerid] = 0;
  67. pCocaina[playerid] = 0;
  68. pCrack[playerid] = 0;
  69.     return 1;
  70. }
  71.  
  72. public OnPlayerDisconnect(playerid, reason)
  73. {
  74. pMaconha[playerid] = 0;
  75. pCocaina[playerid] = 0;
  76. pCrack[playerid] = 0;
  77.     return 1;
  78. }
  79.  
  80. public OnPlayerSpawn(playerid)
  81. {
  82. ApplyAnimation(playerid, "CRACK", "crckdeth2",4.1,1,1,1,1,1);
  83.     return 1;
  84. }
  85.  
  86.  
  87.  
  88. public OnPlayerCommandText(playerid, cmdtext[])
  89. {
  90.     if (strcmp("/comprardrogas", cmdtext, true, 10) == 0)
  91.     {
  92.     if (IsPlayerInRangeOfPoint(playerid,5.0,2176.8103,-984.8187,64.4688))
  93.   {      
  94.   ShowPlayerDialog(playerid, DIALOG_DROGAS, DIALOG_STYLE_LIST, "Menu de Drogas", "Maconha\nCrack\nCocaína", "Selecionar", "Cancelar");
  95.        
  96.     }
  97.     else SendClientMessage(playerid,0xFFFF00AA,"Você não está no ponto de Drogas");
  98.     return 1;
  99.     }
  100.     if (strcmp("/usardrogas", cmdtext, true, 10) == 0)
  101.     {
  102.     if (pMaconha[playerid] >= 1 || pCrack[playerid] >= 1 || pCocaina[playerid] >= 1)
  103.   {
  104.   pMaconha[playerid]--;  
  105.    ShowPlayerDialog(playerid, DIALOG_ESCOLHERDROGAS, DIALOG_STYLE_LIST, "Escolha a Droga que quer usar", "Maconha\nCrack\nCocaína", "Selecionar", "Cancelar");
  106.    
  107.     }
  108.     else SendClientMessage(playerid,0xFFFF00AA,"Você não tem drogas.");
  109.     return 1;
  110.     }
  111.  
  112.  return 0;
  113.  }
  114.  
  115.  
  116.  
  117. public OnPlayerPickUpPickup(playerid, pickupid) {
  118.     if(pickupid == PickupMorroLS) {
  119.     GameTextForPlayer(playerid,"~w~Use ~r~/comprardrogas", 3000,1);
  120.     }
  121.  
  122.     return 1;
  123. }
  124.  
  125.  
  126.  
  127. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  128. {
  129. if(dialogid == DIALOG_DROGAS) // Menu
  130. {
  131.     if(response)
  132.     {
  133.         if(listitem == 0) // maconha
  134.         {
  135.             ShowPlayerDialog(playerid,DIALOG_QUANTIAM,DIALOG_STYLE_INPUT,"Maconha - Digite a Quantidade","Digite a quantidade de Drogas abaixo:","Comprar","Sair");
  136.         }
  137.         if(listitem == 1) // crack
  138.         {
  139.         ShowPlayerDialog(playerid,DIALOG_QUANTIAC,DIALOG_STYLE_INPUT,"Crack - Digite a Quantidade","Digite a quantidade de Drogas abaixo:","Comprar","Sair");
  140.         }
  141.   if(listitem == 2) // cOCAÍNA
  142.         {
  143.             ShowPlayerDialog(playerid,DIALOG_QUANTIACC,DIALOG_STYLE_INPUT,"Cocaína - Digite a Quantidade","Digite a quantidade de Drogas abaixo:","Comprar","Sair");
  144.         }
  145.     }
  146.     return 1;
  147. }
  148.  if(dialogid == DIALOG_QUANTIAM)
  149.     {
  150.         if(!response)
  151.             return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de Drogas");
  152.         if(!strval(inputtext))
  153.             return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de drogas");
  154.         if(strval(inputtext) < 0 || strval(inputtext) > 299)
  155.             return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] quantia Invalida");
  156.  
  157.        
  158.         pMaconha[playerid] = strval(inputtext);
  159.         SendClientMessage(playerid, 0xFFFFFFFF,"Você Comprou Maconha");        
  160.         GivePlayerMoney(playerid,strval(inputtext)*10);
  161.         return 1;
  162.     }    
  163.      if(dialogid == DIALOG_QUANTIAC)
  164.     {
  165.         if(!response)
  166.             return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de Drogas");
  167.         if(!strval(inputtext))
  168.             return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de drogas");
  169.         if(strval(inputtext) < 0 || strval(inputtext) > 299)
  170.             return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] quantia Invalida");
  171.          
  172.        
  173.         pCrack[playerid] = strval(inputtext);        
  174.         SendClientMessage(playerid, 0xFFFFFFFF,"Você Comprou Crack");
  175.         GivePlayerMoney(playerid,strval(inputtext)*10);
  176.         return 1;
  177.     }    
  178.      if(dialogid == DIALOG_QUANTIACC)
  179.     {
  180.         if(!response)
  181.             return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de Drogas");
  182.         if(!strval(inputtext))
  183.             return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de drogas");
  184.         if(strval(inputtext) < 0 || strval(inputtext) > 299)
  185.             return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] quantia Invalida");
  186.          
  187.        
  188.         pCocaina[playerid] = strval(inputtext);        
  189.         SendClientMessage(playerid, 0xFFFFFFFF,"Você Comprou Cocaina");
  190.         GivePlayerMoney(playerid,strval(inputtext)*10);
  191.         return 1;
  192.     }    
  193.      
  194.     if(dialogid == DIALOG_ESCOLHERDROGAS) // Menu
  195. {
  196.     if(response)
  197.     {
  198.         if(listitem == 0) // maconha
  199.         {
  200.             pMaconha[playerid]--;
  201.             GameTextForPlayer(playerid,"~w~Fumando Maconha~r~.~y~.~g~.", 3000,1);            
  202.             ApplyAnimation(playerid,"SMOKING","M_smklean_loop",4.1,1,1,1,1,1);
  203.             SetTimer("FumandoMaconha",5000,false);
  204.             //TogglePlayerControllable(playerid, false);  
  205.         }
  206.         if(listitem == 1) // crack
  207.         {
  208.         pCrack[playerid]--;
  209.   GameTextForPlayer(playerid,"~w~Fumando Crack~r~.~y~.~g~.", 3000,1);  
  210.   ApplyAnimation(playerid,"SMOKING","M_smklean_loop",4.1,1,1,1,1,1);
  211.   SetTimer("FumandoCrack",5000,false);
  212.   //TogglePlayerControllable(playerid, false);  
  213.         }
  214.   if(listitem == 2) // cOCAÍNA
  215.         {
  216.             pCocaina[playerid]--;
  217.    GameTextForPlayer(playerid,"~w~Cheirando Cocaina~r~.~y~.~g~.", 3000,1);
  218.    ApplyAnimation(playerid,"SMOKING","M_smklean_loop",4.1,1,1,1,1,1);
  219.    SetTimer("CheirandoCocaina",5000,false);
  220.    //TogglePlayerControllable(playerid, false);
  221.    
  222.         }
  223.     }
  224.     return 1;
  225. }
  226. }
  227.    
  228.  
  229. public FumandoMaconha(playerid)
  230. {
  231. SetPlayerDrunkLevel(playerid,50000);
  232. SendClientMessage(playerid,0xFFFF00AA,"Você Fumou Maconha, e ficara Tonto por 1 Minuto");
  233. SetTimer("FicarNormal",60000,false);
  234. //TogglePlayerControllable(playerid, true);
  235. }
  236.  
  237. public FumandoCrack(playerid)
  238. {
  239. SetPlayerDrunkLevel(playerid,50000);
  240. SendClientMessage(playerid,0xFFFF00AA,"Você Fumou Crack, e ficara Tonto por 1 Minuto");
  241. SetTimer("FicarNormal",60000,false);
  242. //TogglePlayerControllable(playerid, true);
  243. }
  244.  
  245. public CheirandoCocaina(playerid)
  246. {
  247. SetPlayerDrunkLevel(playerid,50000);
  248. SendClientMessage(playerid,0xFFFF00AA,"Você Cheirou Cocaína, e ficara Tonto por 1 Minuto");
  249. SetTimer("FicarNormal",60000,false);
  250. //TogglePlayerControllable(playerid, true);
  251. }
  252.  
  253. public FicarNormal(playerid)
  254. {
  255. SetPlayerDrunkLevel(playerid,0);
  256. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement