Guest User

Drogas

a guest
Sep 13th, 2012
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 10.67 KB | None | 0 0
  1. /*
  2. Filterscript generated using Zamaroht's TextDraw Editor Version 1.0.
  3. Designed for SA-MP 0.3a.
  4.  
  5. Time and Date: 2012-9-13 @ 10:54:58
  6.  
  7. Instructions:
  8. 1- Compile this file using the compiler provided with the sa-mp server package.
  9. 2- Copy the .amx file to the filterscripts directory.
  10. 3- Add the filterscripts in the server.cfg file (more info here:
  11. http://wiki.sa-mp.com/wiki/Server.cfg)
  12. 4- Run the server!
  13.  
  14. Disclaimer:
  15. You have full rights over this file. You can distribute it, modify it, and
  16. change it as much as you want, without having to give any special credits.
  17. */
  18.  
  19. #include <a_samp>
  20. #include <zcmd>
  21. #include <streamer>
  22. #include <DOF2>
  23. #define DIALOGID1 1
  24. #define DIALOGID2 2
  25. #define DIALOGID3 3
  26. #define DIALOGID4 4
  27. #define DIALOGID5 5
  28.  
  29. new Text:Textdraw0,
  30.     Text:Textdraw1,
  31.     PlayerText:Textdraw2[MAX_PLAYERS],
  32.     PlayerText:Textdraw3[MAX_PLAYERS],
  33.     PlayerText:Textdraw4[MAX_PLAYERS],
  34.     PlayerText:Textdraw5[MAX_PLAYERS],
  35.     Maconha[MAX_PLAYERS],
  36.     Cocaina[MAX_PLAYERS],
  37.     Crack[MAX_PLAYERS],
  38.     Drogass[MAX_PLAYERS],
  39.     pname[50],
  40.     Erv[8]
  41.  
  42.    
  43.    
  44. ;
  45.  
  46. forward Drogas(playerid);
  47. public OnFilterScriptInit()
  48. {
  49.     Textdraw0 = TextDrawCreate(529.000000, 309.000000, ".");
  50.     TextDrawBackgroundColor(Textdraw0, 255);
  51.     TextDrawFont(Textdraw0, 1);
  52.     TextDrawLetterSize(Textdraw0, 0.000000, 9.000000);
  53.     TextDrawColor(Textdraw0, -1);
  54.     TextDrawSetOutline(Textdraw0, 0);
  55.     TextDrawSetProportional(Textdraw0, 1);
  56.     TextDrawSetShadow(Textdraw0, 1);
  57.     TextDrawUseBox(Textdraw0, 1);
  58.     TextDrawBoxColor(Textdraw0, 2949220);
  59.     TextDrawTextSize(Textdraw0, 630.000000, 0.000000);
  60.  
  61.     Textdraw1 = TextDrawCreate(540.000000, 310.000000, "~>~Drogas~<~");
  62.     TextDrawBackgroundColor(Textdraw1, 255);
  63.     TextDrawFont(Textdraw1, 1);
  64.     TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
  65.     TextDrawColor(Textdraw1, -1);
  66.     TextDrawSetOutline(Textdraw1, 0);
  67.     TextDrawSetProportional(Textdraw1, 1);
  68.     TextDrawSetShadow(Textdraw1, 1);
  69.     return 1;
  70. }
  71. public OnFilterScriptExit()
  72. {
  73.     return 1;
  74. }
  75. public OnPlayerConnect(playerid)
  76. {
  77. return 1;
  78. }
  79. public OnPlayerDisconnect(playerid, reason)
  80. {
  81. return 1;
  82. }
  83. public OnPlayerSpawn(playerid)
  84. {
  85.     TextDrawShowForPlayer(playerid, Textdraw0);
  86.     TextDrawShowForPlayer(playerid, Textdraw1);
  87.     Textdraw2[playerid] = CreatePlayerTextDraw(playerid,530.000000, 330.000000, "_");
  88.     PlayerTextDrawBackgroundColor(playerid,Textdraw2[playerid], 255);
  89.     PlayerTextDrawFont(playerid,Textdraw2[playerid], 1);
  90.     PlayerTextDrawLetterSize(playerid,Textdraw2[playerid], 0.500000, 1.000000);
  91.     PlayerTextDrawColor(playerid,Textdraw2[playerid], -1);
  92.     PlayerTextDrawSetOutline(playerid,Textdraw2[playerid], 0);
  93.     PlayerTextDrawSetProportional(playerid,Textdraw2[playerid], 1);
  94.     PlayerTextDrawSetShadow(playerid,Textdraw2[playerid], 1);
  95.     PlayerTextDrawShow(playerid, Textdraw2[playerid]);
  96.  
  97.     Textdraw3[playerid] = CreatePlayerTextDraw(playerid,530.000000, 344.000000, "_");
  98.     PlayerTextDrawBackgroundColor(playerid,Textdraw3[playerid], 255);
  99.     PlayerTextDrawFont(playerid,Textdraw3[playerid], 1);
  100.     PlayerTextDrawLetterSize(playerid,Textdraw3[playerid], 0.500000, 1.000000);
  101.     PlayerTextDrawColor(playerid,Textdraw3[playerid], -1);
  102.     PlayerTextDrawSetOutline(playerid,Textdraw3[playerid], 0);
  103.     PlayerTextDrawSetProportional(playerid,Textdraw3[playerid], 1);
  104.     PlayerTextDrawSetShadow(playerid,Textdraw3[playerid], 1);
  105.     PlayerTextDrawShow(playerid, Textdraw3[playerid]);
  106.  
  107.     Textdraw4[playerid] = CreatePlayerTextDraw(playerid,530.000000, 360.000000, "_");
  108.     PlayerTextDrawBackgroundColor(playerid,Textdraw4[playerid], 255);
  109.     PlayerTextDrawFont(playerid,Textdraw4[playerid], 1);
  110.     PlayerTextDrawLetterSize(playerid,Textdraw4[playerid], 0.500000, 1.000000);
  111.     PlayerTextDrawColor(playerid,Textdraw4[playerid], -1);
  112.     PlayerTextDrawSetOutline(playerid,Textdraw4[playerid], 0);
  113.     PlayerTextDrawSetProportional(playerid,Textdraw4[playerid], 1);
  114.     PlayerTextDrawSetShadow(playerid,Textdraw4[playerid], 1);
  115.     PlayerTextDrawShow(playerid, Textdraw4[playerid]);
  116.     Drogas(playerid);
  117.    
  118.     Textdraw5[playerid] = CreatePlayerTextDraw(playerid,529.000000, 379.000000, "_");
  119.     PlayerTextDrawBackgroundColor(playerid,Textdraw5[playerid], 255);
  120.     PlayerTextDrawFont(playerid,Textdraw5[playerid], 1);
  121.     PlayerTextDrawLetterSize(playerid,Textdraw5[playerid], 0.429999, 0.800000);
  122.     PlayerTextDrawColor(playerid,Textdraw5[playerid], -1);
  123.     PlayerTextDrawSetOutline(playerid,Textdraw5[playerid], 0);
  124.     PlayerTextDrawSetProportional(playerid,Textdraw5[playerid], 1);
  125.     PlayerTextDrawSetShadow(playerid,Textdraw5[playerid], 1);
  126.     PlayerTextDrawShow(playerid, Textdraw5[playerid]);
  127.     Drogas(playerid);
  128.  
  129.     return 1;
  130. }
  131. public Drogas(playerid)
  132. {
  133.     new Viciado[100],string[100];
  134.     if(Drogass[playerid] == 0) Viciado = "Suave";
  135.     if(Drogass[playerid] == 1) Viciado = "Razuavel";
  136.     if(Drogass[playerid] == 2) Viciado = "zonzo";
  137.     if(Drogass[playerid] == 3) Viciado = "Doido";
  138.     if(Drogass[playerid] == 4) Viciado = "Noia";
  139.     if(Drogass[playerid] >= 5) Viciado = "Alucinado";
  140.     format(string,sizeof(string),"~r~ Maconha: ~w~%d",Maconha[playerid]);
  141.     PlayerTextDrawSetString(playerid, Textdraw2[playerid],string);
  142.     format(string,sizeof(string), "~r~ Crack:~w~%d",Crack[playerid]);
  143.     PlayerTextDrawSetString(playerid, Textdraw4[playerid], string);
  144.     format(string,sizeof(string), "~r~ Cocaina:~w~%d",Cocaina[playerid]);
  145.     PlayerTextDrawSetString(playerid, Textdraw3[playerid], string);
  146.     format(string,sizeof(string), "~r~Vicio: ~w~%s",Viciado);
  147.     PlayerTextDrawSetString(playerid, Textdraw5[playerid], string);
  148.     return 1;
  149. }
  150.  
  151. CMD:drogas(playerid, params[])
  152. {
  153.   ShowPlayerDialog(playerid, DIALOGID1,DIALOG_STYLE_LIST, "DROGAS","Comprar Drogas\nUsar Drogas\nPlantar Erva","","");
  154.   return 1;
  155. }
  156.  
  157. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  158. {
  159.     if(dialogid == DIALOGID1){
  160.     if(response){
  161.     switch(listitem){
  162.     case 0:{ShowPlayerDialog(playerid, 2,DIALOG_STYLE_LIST, "Selecione A Droga","Cocaina\nMaconha\nCrack","Comprar","Cancelar");}
  163.     case 1:{ShowPlayerDialog(playerid, 3,DIALOG_STYLE_LIST, "Selecione Sua Intorpecente","Cocaina\nMaconha\nCrack","Usar","Cancelar");}
  164.     case 2:{
  165.     SetPlayerPos(playerid, -376.5437,110.3776,14.9388);
  166.     SendClientMessage(playerid, 0xFFCCFF, "Use:/Plantar || /Colher");
  167.     }
  168.     }
  169.     }
  170.     }
  171.     if(dialogid == 2){
  172.     if(response){
  173.     switch(listitem){
  174.     case 0:{
  175.     new string[100];
  176.     GetPlayerName(playerid, pname,25);
  177.     format(string,sizeof(string), "[DROGAS]: O Traficante %s Comprou uma Farinha Da Boa",pname);
  178.     SendClientMessage(playerid, 0xFFFFCC, string);
  179.     Cocaina[playerid]++;
  180.     Drogas(playerid);
  181.     }
  182.     case 1:{
  183.     new string[100];
  184.     GetPlayerName(playerid, pname,25);
  185.     format(string,sizeof(string), "[DROGAS]: O Traficante %s Comprou uma Maconha Da Boa",pname);
  186.     SendClientMessage(playerid, 0xFFFFCC, string);
  187.     Maconha[playerid]++;
  188.     Drogas(playerid);
  189.     }
  190.     case 2:{
  191.     new string[100];
  192.     GetPlayerName(playerid, pname,25);
  193.     format(string,sizeof(string), "[DROGAS]: O Traficante %s Comprou uma Pedra De Crack",pname);
  194.     SendClientMessage(playerid, 0xFFFFCC, string);
  195.     Crack[playerid]++;
  196.     Drogas(playerid);
  197.     }
  198.     }
  199.     }
  200.     }
  201.     if(dialogid == 3){
  202.     if(response){
  203.     switch(listitem){
  204.     case 0:{
  205.     new string[100];
  206.     if(Cocaina[playerid] == 0) return SendClientMessage(playerid, -1, "Erro: Voce Não Tem Cocaina Para Cheira!");
  207.     GetPlayerName(playerid, pname,25);
  208.     format(string,sizeof(string), "[DROGAS]: O Usuario %s Acabou De Usa Chera Cocaina Cuidado ",pname);
  209.     SendClientMessage(playerid, 0xFFFFCC, string);
  210.     Drogass[playerid]++;
  211.     Cocaina[playerid]--;
  212.     Drogas(playerid);
  213.     }
  214.     case 1:{
  215.     new string[100];
  216.     if(Maconha[playerid] == 0) return SendClientMessage(playerid, -1, "Erro: Voce Não Tem Maconha Para Fica Doidão");
  217.     GetPlayerName(playerid, pname,25);
  218.     format(string,sizeof(string), "[DROGAS]: O Usuario %s Acabou De Fuma um Beck do Baum",pname);
  219.     SendClientMessage(playerid, 0xFFFFCC, string);
  220.     ApplyAnimation(playerid,"SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, 0);
  221.     Drogass[playerid]++;
  222.     Maconha[playerid]--;
  223.     Drogas(playerid);
  224.     }
  225.     case 2:{
  226.     new string[100];
  227.     if(Crack[playerid] == 0) return SendClientMessage(playerid, -1, "Erro: Voce Não Tem Pedra De Crack Pra Usa");
  228.     GetPlayerName(playerid, pname,25);
  229.     format(string,sizeof(string), "[DROGAS]: O Usuario %s Acabou De Usa um Crack Como e Bom Ser Vida Loka ",pname);
  230.     SendClientMessage(playerid, 0xFFFFCC, string);
  231.     ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
  232.     Drogass[playerid]++;
  233.     Crack[playerid]--;
  234.     Drogas(playerid);
  235.     }
  236.     }
  237.     }
  238.     }
  239.     return 1;
  240. }
  241. CMD:plantar(playerid)
  242. {
  243.    new string[100];
  244.    Erv[0] = CreateDynamicObject(3409,-341.09130859,138.72921753,7.04942703,352.00000000,0.00000000,344.00000000); //object(grassplant) (1)
  245.    Erv[1] = CreateDynamicObject(3409,-333.84725952,136.82508850,6.31399918,351.99645996,0.00000000,343.99841309); //object(grassplant) (2)
  246.    Erv[2] = CreateDynamicObject(3409,-327.50488281,134.96852112,5.69084930,351.99645996,0.00000000,343.99841309); //object(grassplant) (3)
  247.    Erv[3] = CreateDynamicObject(3409,-320.55874634,132.23471069,5.09584999,351.99645996,0.00000000,343.99841309); //object(grassplant) (4)
  248.    Erv[4] = CreateDynamicObject(3409,-342.51849365,133.89282227,7.84910393,351.99645996,0.00000000,343.99841309); //object(grassplant) (5)
  249.    Erv[5] = CreateDynamicObject(3409,-335.21917725,131.63703918,7.14680481,351.99645996,0.00000000,343.99841309); //object(grassplant) (6)
  250.    Erv[6] = CreateDynamicObject(3409,-328.84869385,129.94403076,6.49943542,351.99645996,0.00000000,343.99841309); //object(grassplant) (7)
  251.    Erv[7] = CreateDynamicObject(3409,-321.58294678,127.32243347,5.84734344,351.99645996,0.00000000,343.99841309); //object(grassplant) (8)
  252.    GetPlayerName(playerid, pname,25);
  253.    format(string,sizeof(string), "[DROGAS]:Trafico Pesado %s Fez uma Orta De Maconha",pname);
  254.    SendClientMessageToAll(0xFFFFAA, string);
  255.    SendClientMessage(playerid, 0xFFCCAA, "Voce Plantou Muita Maconha Da Boa hum Como E Bom Ser vida Loka");
  256.    return 1;
  257. }
  258. CMD:colher(playerid)
  259. {
  260.    new string[100];
  261.    DestroyDynamicObject(Erv[0]); //object(grassplant) (1)
  262.    DestroyDynamicObject(Erv[1]); //object(grassplant) (1)
  263.    DestroyDynamicObject(Erv[2]); //object(grassplant) (1)
  264.    DestroyDynamicObject(Erv[3]); //object(grassplant) (1)
  265.    DestroyDynamicObject(Erv[4]); //object(grassplant) (1)
  266.    DestroyDynamicObject(Erv[5]); //object(grassplant) (1)
  267.    DestroyDynamicObject(Erv[6]); //object(grassplant) (1)
  268.    DestroyDynamicObject(Erv[7]); //object(grassplant) (1)
  269.    GetPlayerName(playerid, pname,25);
  270.    format(string,sizeof(string), "[DROGAS]:Trafico Pesado %s Fez a Colheta  Da Orta De Maconha",pname);
  271.    SendClientMessage(playerid, 0xFFCCAA, "Voce Colheu Todas As Ervas");
  272.    return 1;
  273. }
Advertisement
Add Comment
Please, Sign In to add comment