bruno_travi

Bafore13

Jul 31st, 2014
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 24.59 KB | None | 0 0
  1. //=================== | INCLUDES | ====================
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <sscanf>
  5. #include <DOF2>
  6.  
  7. //==================== | MACROS | =====================
  8. new stringf[100];
  9. #define SendFormatMsg(%0,%1,%2,%3) format(stringf, sizeof(stringf),%2,%3) && SendClientMessage(%0, %1, stringf)
  10.  
  11. //==================== | DEFINES | ====================
  12. #define COR_ROXOCLARO 0xC2A2DAFF
  13. #define COR_VERMELHO 0xCD5C5CFF
  14.  
  15. //=================== | VARIÁVEIS | ===================
  16. new Text:TxtSmoke[MAX_PLAYERS][30];
  17. new bool:Cigarros[MAX_PLAYERS][5];
  18. new bool:AbriuCarteira[MAX_PLAYERS] = false;
  19. new bool:FumandoCigarro[MAX_PLAYERS] = false;
  20. new Tragadas[MAX_PLAYERS];
  21. new TimeTragada[MAX_PLAYERS];
  22. new TimerTC[MAX_PLAYERS];
  23.  
  24. //==================== | FUNÇÕES | ====================
  25. Nome(playerid)
  26. {
  27.     new name[MAX_PLAYER_NAME];
  28.     GetPlayerName(playerid, name, sizeof(name));
  29.     return name;
  30. }
  31.  
  32. stock SetCigarro(playerid)
  33. {
  34.     new Float:Px, Float:Py, Float:Pz; GetPlayerPos(playerid, Px, Py, Pz);
  35.     AbriuCarteira[playerid] = false;
  36.     FumandoCigarro[playerid] = true;
  37.     Tragadas[playerid] = 6;
  38.     SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
  39.     for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 10.0, Px, Py, Pz)) SendFormatMsg(i, COR_ROXOCLARO, "%s acende um cigarro", Nome(playerid));
  40.     TimerTC[playerid] = SetTimerEx("TerminarCigarro", 60000, false, "i", playerid);
  41.     return 1;
  42. }
  43.  
  44. stock AtualizarCigarros(playerid)
  45. {
  46.     if(AbriuCarteira[playerid] == false) return 1;
  47.     if(Cigarros[playerid][0] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][1]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][2]);
  48.     if(Cigarros[playerid][1] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][3]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][7]);
  49.     if(Cigarros[playerid][2] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][4]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][8]);
  50.     if(Cigarros[playerid][3] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][5]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][9]);
  51.     if(Cigarros[playerid][4] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][6]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][10]);
  52.     return 1;
  53. }
  54.  
  55. stock DarCigarros(playerid, quantia)
  56. {
  57.     new contar[MAX_PLAYERS] = 0;
  58.     if(Cigarros[playerid][0] == false)
  59.     {
  60.         Cigarros[playerid][0] = true;
  61.         contar[playerid] ++;
  62.         if(contar[playerid] == quantia) return 1;
  63.     }
  64.     if(Cigarros[playerid][1] == false)
  65.     {
  66.         Cigarros[playerid][1] = true;
  67.         contar[playerid] ++;
  68.         if(contar[playerid] == quantia) return 1;
  69.     }
  70.     if(Cigarros[playerid][2] == false)
  71.     {
  72.         Cigarros[playerid][2] = true;
  73.         contar[playerid] ++;
  74.         if(contar[playerid] == quantia) return 1;
  75.     }
  76.     if(Cigarros[playerid][3] == false)
  77.     {
  78.         Cigarros[playerid][3] = true;
  79.         contar[playerid] ++;
  80.         if(contar[playerid] == quantia) return 1;
  81.     }
  82.     if(Cigarros[playerid][4] == false)
  83.     {
  84.         Cigarros[playerid][4] = true;
  85.         contar[playerid] ++;
  86.         if(contar[playerid] == quantia) return 1;
  87.     }
  88.     return 1;
  89. }
  90.  
  91. //================== |  CALLBACKS | ====================
  92. public OnFilterScriptInit()
  93. {
  94.     print("  Bafore13 Carregado!");
  95.     for (new i = 0; i < GetMaxPlayers(); i++)
  96.     {
  97.         TxtSmoke[i][0] = TextDrawCreate(631.529418, 435.166687, "LD_SPAC:white");
  98.         TextDrawLetterSize(TxtSmoke[i][0], 0.000000, 0.000000);
  99.         TextDrawTextSize(TxtSmoke[i][0], -105.882385, -173.250000);
  100.         TextDrawAlignment(TxtSmoke[i][0], 1);
  101.         TextDrawColor(TxtSmoke[i][0], -1);
  102.         TextDrawSetShadow(TxtSmoke[i][0], 0);
  103.         TextDrawSetOutline(TxtSmoke[i][0], 0);
  104.         TextDrawFont(TxtSmoke[i][0], 4);
  105.  
  106.         TxtSmoke[i][1] = TextDrawCreate(538.058715, 267.833312, "LD_SPAC:white");
  107.         TextDrawLetterSize(TxtSmoke[i][1], 0.000000, 0.000000);
  108.         TextDrawTextSize(TxtSmoke[i][1], 10.352966, 38.333312);//10.352966, 121.333312
  109.         TextDrawAlignment(TxtSmoke[i][1], 1);
  110.         TextDrawColor(TxtSmoke[i][1], -1974466817);
  111.         TextDrawSetShadow(TxtSmoke[i][1], 0);
  112.         TextDrawSetOutline(TxtSmoke[i][1], 0);
  113.         TextDrawFont(TxtSmoke[i][1], 4);
  114.         TextDrawUseBox(TxtSmoke[i][1], 1);
  115.         TextDrawBoxColor(TxtSmoke[i][1], -256);
  116.  
  117.         TxtSmoke[i][2] = TextDrawCreate(537.763977, 266.166473, "LD_POOL:ball");
  118.         TextDrawLetterSize(TxtSmoke[i][2], 0.000000, 0.000000);
  119.         TextDrawTextSize(TxtSmoke[i][2], 10.823541, 4.083354);
  120.         TextDrawAlignment(TxtSmoke[i][2], 1);
  121.         TextDrawColor(TxtSmoke[i][2], -2138668801);
  122.         TextDrawSetShadow(TxtSmoke[i][2], 0);
  123.         TextDrawSetOutline(TxtSmoke[i][2], 0);
  124.         TextDrawFont(TxtSmoke[i][2], 4);
  125.  
  126.         TxtSmoke[i][3] = TextDrawCreate(555.999633, 268.833343, "LD_SPAC:white");
  127.         TextDrawLetterSize(TxtSmoke[i][3], 0.000000, 0.000000);
  128.         TextDrawTextSize(TxtSmoke[i][3], 10.352966, 38.333312);//121.333312
  129.         TextDrawAlignment(TxtSmoke[i][3], 1);
  130.         TextDrawColor(TxtSmoke[i][3], -1974466817);
  131.         TextDrawSetShadow(TxtSmoke[i][3], 0);
  132.         TextDrawSetOutline(TxtSmoke[i][3], 0);
  133.         TextDrawFont(TxtSmoke[i][3], 4);
  134.         TextDrawUseBox(TxtSmoke[i][3], 1);
  135.         TextDrawBoxColor(TxtSmoke[i][3], -256);
  136.  
  137.         TxtSmoke[i][4] = TextDrawCreate(573.940979, 268.666656, "LD_SPAC:white");
  138.         TextDrawLetterSize(TxtSmoke[i][4], 0.000000, 0.000000);
  139.         TextDrawTextSize(TxtSmoke[i][4], 10.352966, 38.333312);
  140.         TextDrawAlignment(TxtSmoke[i][4], 1);
  141.         TextDrawColor(TxtSmoke[i][4], -1974466817);
  142.         TextDrawSetShadow(TxtSmoke[i][4], 0);
  143.         TextDrawSetOutline(TxtSmoke[i][4], 0);
  144.         TextDrawFont(TxtSmoke[i][4], 4);
  145.         TextDrawUseBox(TxtSmoke[i][4], 1);
  146.         TextDrawBoxColor(TxtSmoke[i][4], -256);
  147.        
  148.         TxtSmoke[i][5] = TextDrawCreate(590.529296, 268.333282, "LD_SPAC:white");
  149.         TextDrawLetterSize(TxtSmoke[i][5], 0.000000, 0.000000);
  150.         TextDrawTextSize(TxtSmoke[i][5], 10.352966, 38.333312);
  151.         TextDrawAlignment(TxtSmoke[i][5], 1);
  152.         TextDrawColor(TxtSmoke[i][5], -1974466817);
  153.         TextDrawSetShadow(TxtSmoke[i][5], 0);
  154.         TextDrawSetOutline(TxtSmoke[i][5], 0);
  155.         TextDrawFont(TxtSmoke[i][5], 4);
  156.         TextDrawUseBox(TxtSmoke[i][5], 1);
  157.         TextDrawBoxColor(TxtSmoke[i][5], -256);
  158.  
  159.         TxtSmoke[i][6] = TextDrawCreate(607.411499, 268.499969, "LD_SPAC:white");
  160.         TextDrawLetterSize(TxtSmoke[i][6], 0.000000, 0.000000);
  161.         TextDrawTextSize(TxtSmoke[i][6], 10.352966, 38.333312);
  162.         TextDrawAlignment(TxtSmoke[i][6], 1);
  163.         TextDrawColor(TxtSmoke[i][6], -1974466817);
  164.         TextDrawSetShadow(TxtSmoke[i][6], 0);
  165.         TextDrawSetOutline(TxtSmoke[i][6], 0);
  166.         TextDrawFont(TxtSmoke[i][6], 4);
  167.         TextDrawUseBox(TxtSmoke[i][6], 1);
  168.         TextDrawBoxColor(TxtSmoke[i][6], -256);
  169.        
  170.         TxtSmoke[i][7] = TextDrawCreate(555.705017, 265.999847, "LD_POOL:ball");
  171.         TextDrawLetterSize(TxtSmoke[i][7], 0.000000, 0.000000);
  172.         TextDrawTextSize(TxtSmoke[i][7], 10.823541, 4.083354);
  173.         TextDrawAlignment(TxtSmoke[i][7], 1);
  174.         TextDrawColor(TxtSmoke[i][7], -2138668801);
  175.         TextDrawSetShadow(TxtSmoke[i][7], 0);
  176.         TextDrawSetOutline(TxtSmoke[i][7], 0);
  177.         TextDrawFont(TxtSmoke[i][7], 4);
  178.         TextDrawSetPreviewModel(TxtSmoke[i][7], 3044);
  179.         TextDrawSetPreviewRot(TxtSmoke[i][7], 352.000000, 240.000000, 0.000000, 0.000000);
  180.  
  181.         TxtSmoke[i][8] = TextDrawCreate(573.646118, 265.833160, "LD_POOL:ball");
  182.         TextDrawLetterSize(TxtSmoke[i][8], 0.000000, 0.000000);
  183.         TextDrawTextSize(TxtSmoke[i][8], 10.823541, 4.083354);
  184.         TextDrawAlignment(TxtSmoke[i][8], 1);
  185.         TextDrawColor(TxtSmoke[i][8], -2138668801);
  186.         TextDrawSetShadow(TxtSmoke[i][8], 0);
  187.         TextDrawSetOutline(TxtSmoke[i][8], 0);
  188.         TextDrawFont(TxtSmoke[i][8], 4);
  189.         TextDrawSetPreviewModel(TxtSmoke[i][8], 3044);
  190.         TextDrawSetPreviewRot(TxtSmoke[i][8], 352.000000, 240.000000, 0.000000, 0.000000);
  191.  
  192.         TxtSmoke[i][9] = TextDrawCreate(590.175292, 265.666503, "LD_POOL:ball");
  193.         TextDrawLetterSize(TxtSmoke[i][9], 0.000000, 0.000000);
  194.         TextDrawTextSize(TxtSmoke[i][9], 10.823541, 4.083354);
  195.         TextDrawAlignment(TxtSmoke[i][9], 1);
  196.         TextDrawColor(TxtSmoke[i][9], -2138668801);
  197.         TextDrawSetShadow(TxtSmoke[i][9], 0);
  198.         TextDrawSetOutline(TxtSmoke[i][9], 0);
  199.         TextDrawFont(TxtSmoke[i][9], 4);
  200.         TextDrawSetPreviewModel(TxtSmoke[i][9], 3044);
  201.         TextDrawSetPreviewRot(TxtSmoke[i][9], 352.000000, 240.000000, 0.000000, 0.000000);
  202.  
  203.         TxtSmoke[i][10] = TextDrawCreate(607.175231, 266.083129, "LD_POOL:ball");
  204.         TextDrawLetterSize(TxtSmoke[i][10], 0.000000, 0.000000);
  205.         TextDrawTextSize(TxtSmoke[i][10], 10.823541, 4.083354);
  206.         TextDrawAlignment(TxtSmoke[i][10], 1);
  207.         TextDrawColor(TxtSmoke[i][10], -2138668801);
  208.         TextDrawSetShadow(TxtSmoke[i][10], 0);
  209.         TextDrawSetOutline(TxtSmoke[i][10], 0);
  210.         TextDrawFont(TxtSmoke[i][10], 4);
  211.         TextDrawSetPreviewModel(TxtSmoke[i][10], 3044);
  212.         TextDrawSetPreviewRot(TxtSmoke[i][10], 352.000000, 240.000000, 0.000000, 0.000000);
  213.  
  214.         TxtSmoke[i][11] = TextDrawCreate(525.647033, 261.916351, "LD_SPAC:white");
  215.         TextDrawLetterSize(TxtSmoke[i][11], 0.000000, 0.000000);
  216.         TextDrawTextSize(TxtSmoke[i][11], 9.411779, 46.083328);
  217.         TextDrawAlignment(TxtSmoke[i][11], 1);
  218.         TextDrawColor(TxtSmoke[i][11], 8388863);
  219.         TextDrawSetShadow(TxtSmoke[i][11], 0);
  220.         TextDrawSetOutline(TxtSmoke[i][11], 0);
  221.         TextDrawFont(TxtSmoke[i][11], 4);
  222.  
  223.         TxtSmoke[i][12] = TextDrawCreate(621.705688, 261.749908, "LD_SPAC:white");
  224.         TextDrawLetterSize(TxtSmoke[i][12], 0.000000, 0.000000);
  225.         TextDrawTextSize(TxtSmoke[i][12], 9.411779, 46.083316);
  226.         TextDrawAlignment(TxtSmoke[i][12], 1);
  227.         TextDrawColor(TxtSmoke[i][12], 8388863);
  228.         TextDrawSetShadow(TxtSmoke[i][12], 0);
  229.         TextDrawSetOutline(TxtSmoke[i][12], 0);
  230.         TextDrawFont(TxtSmoke[i][12], 4);
  231.  
  232.         TxtSmoke[i][13] = TextDrawCreate(525.294006, 304.166534, "LD_SPAC:white");
  233.         TextDrawLetterSize(TxtSmoke[i][13], 0.000000, 0.000000);
  234.         TextDrawTextSize(TxtSmoke[i][13], 105.882408, 123.083358);
  235.         TextDrawAlignment(TxtSmoke[i][13], 1);
  236.         TextDrawColor(TxtSmoke[i][13], 8388863);
  237.         TextDrawSetShadow(TxtSmoke[i][13], 0);
  238.         TextDrawSetOutline(TxtSmoke[i][13], 0);
  239.         TextDrawFont(TxtSmoke[i][13], 4);
  240.  
  241.         TxtSmoke[i][14] = TextDrawCreate(525.647033, 315.583312, "LD_SPAC:white");
  242.         TextDrawLetterSize(TxtSmoke[i][14], 0.000000, 0.000000);
  243.         TextDrawTextSize(TxtSmoke[i][14], 105.882392, 119.583343);
  244.         TextDrawAlignment(TxtSmoke[i][14], 1);
  245.         TextDrawColor(TxtSmoke[i][14], -1);
  246.         TextDrawSetShadow(TxtSmoke[i][14], 0);
  247.         TextDrawSetOutline(TxtSmoke[i][14], 0);
  248.         TextDrawFont(TxtSmoke[i][14], 4);
  249.  
  250.         TxtSmoke[i][15] = TextDrawCreate(525.235412, 261.749847, "LD_SPAC:white");
  251.         TextDrawLetterSize(TxtSmoke[i][15], 0.000000, 0.000000);
  252.         TextDrawTextSize(TxtSmoke[i][15], 105.882392, 51.916645);
  253.         TextDrawAlignment(TxtSmoke[i][15], 1);
  254.         TextDrawColor(TxtSmoke[i][15], -1);
  255.         TextDrawSetShadow(TxtSmoke[i][15], 0);
  256.         TextDrawSetOutline(TxtSmoke[i][15], 0);
  257.         TextDrawFont(TxtSmoke[i][15], 4);
  258.         TextDrawUseBox(TxtSmoke[i][15], 1);
  259.         TextDrawBoxColor(TxtSmoke[i][15], -256);
  260.        
  261.         TxtSmoke[i][16] = TextDrawCreate(549.176452, 299.833312, "LD_SPAC:white");
  262.         TextDrawLetterSize(TxtSmoke[i][16], 0.000000, 0.000000);
  263.         TextDrawTextSize(TxtSmoke[i][16], 60.235252, 14.000003);
  264.         TextDrawAlignment(TxtSmoke[i][16], 1);
  265.         TextDrawColor(TxtSmoke[i][16], -16776961);
  266.         TextDrawUseBox(TxtSmoke[i][16], true);
  267.         TextDrawBoxColor(TxtSmoke[i][16], 0);
  268.         TextDrawSetShadow(TxtSmoke[i][16], 0);
  269.         TextDrawSetOutline(TxtSmoke[i][16], 0);
  270.         TextDrawFont(TxtSmoke[i][16], 4);
  271.  
  272.         TxtSmoke[i][17] = TextDrawCreate(528.000000, 343.000030, "LD_SPAC:white");
  273.         TextDrawLetterSize(TxtSmoke[i][17], 0.000000, 0.000000);
  274.         TextDrawTextSize(TxtSmoke[i][17], 101.176467, 89.250022);
  275.         TextDrawAlignment(TxtSmoke[i][17], 1);
  276.         TextDrawColor(TxtSmoke[i][17], 255);
  277.         TextDrawSetShadow(TxtSmoke[i][17], 0);
  278.         TextDrawSetOutline(TxtSmoke[i][17], 0);
  279.         TextDrawFont(TxtSmoke[i][17], 4);
  280.  
  281.         TxtSmoke[i][18] = TextDrawCreate(531.823486, 349.250122, "LD_SPAC:white");
  282.         TextDrawLetterSize(TxtSmoke[i][18], 0.000000, 0.000000);
  283.         TextDrawTextSize(TxtSmoke[i][18], 91.764694, 77.000022);
  284.         TextDrawAlignment(TxtSmoke[i][18], 1);
  285.         TextDrawColor(TxtSmoke[i][18], -1);
  286.         TextDrawUseBox(TxtSmoke[i][18], true);
  287.         TextDrawBoxColor(TxtSmoke[i][18], 0);
  288.         TextDrawSetShadow(TxtSmoke[i][18], 0);
  289.         TextDrawSetOutline(TxtSmoke[i][18], 0);
  290.         TextDrawFont(TxtSmoke[i][18], 4);
  291.  
  292.         TxtSmoke[i][19] = TextDrawCreate(546.823242, 358.166687, "Fumar");
  293.         TextDrawLetterSize(TxtSmoke[i][19], 0.449999, 1.600000);
  294.         TextDrawAlignment(TxtSmoke[i][19], 1);
  295.         TextDrawColor(TxtSmoke[i][19], -1);
  296.         TextDrawUseBox(TxtSmoke[i][19], true);
  297.         TextDrawBoxColor(TxtSmoke[i][19], 0);
  298.         TextDrawSetShadow(TxtSmoke[i][19], 0);
  299.         TextDrawSetOutline(TxtSmoke[i][19], 1);
  300.         TextDrawBackgroundColor(TxtSmoke[i][19], 255);
  301.         TextDrawFont(TxtSmoke[i][19], 2);
  302.         TextDrawSetProportional(TxtSmoke[i][19], 1);
  303.  
  304.         TxtSmoke[i][20] = TextDrawCreate(552.529235, 395.917053, "Mata");
  305.         TextDrawLetterSize(TxtSmoke[i][20], 0.449999, 1.600000);
  306.         TextDrawAlignment(TxtSmoke[i][20], 1);
  307.         TextDrawColor(TxtSmoke[i][20], -1);
  308.         TextDrawUseBox(TxtSmoke[i][20], true);
  309.         TextDrawBoxColor(TxtSmoke[i][20], 0);
  310.         TextDrawSetShadow(TxtSmoke[i][20], 0);
  311.         TextDrawSetOutline(TxtSmoke[i][20], 1);
  312.         TextDrawBackgroundColor(TxtSmoke[i][20], 255);
  313.         TextDrawFont(TxtSmoke[i][20], 2);
  314.         TextDrawSetProportional(TxtSmoke[i][20], 1);
  315.  
  316.         TxtSmoke[i][21] = TextDrawCreate(564.235961, 371.583251, "LD_TATT:9homby");
  317.         TextDrawLetterSize(TxtSmoke[i][21], 0.000000, 0.000000);
  318.         TextDrawTextSize(TxtSmoke[i][21], 30.588249, 29.166631);
  319.         TextDrawAlignment(TxtSmoke[i][21], 1);
  320.         TextDrawColor(TxtSmoke[i][21], -1);
  321.         TextDrawSetShadow(TxtSmoke[i][21], 0);
  322.         TextDrawSetOutline(TxtSmoke[i][21], 0);
  323.         TextDrawFont(TxtSmoke[i][21], 4);
  324.  
  325.         TxtSmoke[i][22] = TextDrawCreate(631.529418, 261.916717, "LD_SPAC:white");
  326.         TextDrawLetterSize(TxtSmoke[i][22], 0.000000, 0.000000);
  327.         TextDrawTextSize(TxtSmoke[i][22], -105.882369, 2.333314);
  328.         TextDrawAlignment(TxtSmoke[i][22], 1);
  329.         TextDrawColor(TxtSmoke[i][22], -16776961);
  330.         TextDrawUseBox(TxtSmoke[i][22], true);
  331.         TextDrawBoxColor(TxtSmoke[i][22], 0);
  332.         TextDrawSetShadow(TxtSmoke[i][22], 0);
  333.         TextDrawSetOutline(TxtSmoke[i][22], 0);
  334.         TextDrawFont(TxtSmoke[i][22], 4);
  335.  
  336.         TxtSmoke[i][23] = TextDrawCreate(548.764770, 315.416595, "LD_SPAC:white");
  337.         TextDrawLetterSize(TxtSmoke[i][23], 0.000000, 0.000000);
  338.         TextDrawTextSize(TxtSmoke[i][23], 60.235267, 18.083335);
  339.         TextDrawAlignment(TxtSmoke[i][23], 1);
  340.         TextDrawColor(TxtSmoke[i][23], -16776961);
  341.         TextDrawSetShadow(TxtSmoke[i][23], 0);
  342.         TextDrawSetOutline(TxtSmoke[i][23], 0);
  343.         TextDrawFont(TxtSmoke[i][23], 4);
  344.  
  345.         TxtSmoke[i][24] = TextDrawCreate(550.705932, 301.833282, "LD_SPAC:white");
  346.         TextDrawLetterSize(TxtSmoke[i][24], 0.000000, 0.000000);
  347.         TextDrawTextSize(TxtSmoke[i][24], 56.470558, 11.666671);
  348.         TextDrawAlignment(TxtSmoke[i][24], 1);
  349.         TextDrawColor(TxtSmoke[i][24], -1);
  350.         TextDrawSetShadow(TxtSmoke[i][24], 0);
  351.         TextDrawSetOutline(TxtSmoke[i][24], 0);
  352.         TextDrawFont(TxtSmoke[i][24], 4);/**/
  353.  
  354.         TxtSmoke[i][25] = TextDrawCreate(525.235412, 261.749847, "LD_SPAC:white");//movido
  355.         TextDrawLetterSize(TxtSmoke[i][25], 0.000000, 0.000000);
  356.         TextDrawTextSize(TxtSmoke[i][25], 105.882392, 51.916645);
  357.         TextDrawColor(TxtSmoke[i][25], -256);
  358.         TextDrawFont(TxtSmoke[i][25], 4);
  359.         TextDrawUseBox(TxtSmoke[i][25], 1);
  360.         TextDrawBoxColor(TxtSmoke[i][25], -256);
  361.  
  362.         TxtSmoke[i][26] = TextDrawCreate(562.941406, 300.083465, "Cigarro");
  363.         TextDrawLetterSize(TxtSmoke[i][26], 0.374706, 1.360832);
  364.         TextDrawTextSize(TxtSmoke[i][26], 0.000000, -18.083333);
  365.         TextDrawAlignment(TxtSmoke[i][26], 1);
  366.         TextDrawColor(TxtSmoke[i][26], 255);
  367.         TextDrawUseBox(TxtSmoke[i][26], true);
  368.         TextDrawBoxColor(TxtSmoke[i][26], 0);
  369.         TextDrawSetShadow(TxtSmoke[i][26], 0);
  370.         TextDrawSetOutline(TxtSmoke[i][26], 0);
  371.         TextDrawBackgroundColor(TxtSmoke[i][26], 255);
  372.         TextDrawFont(TxtSmoke[i][26], 0);
  373.         TextDrawSetProportional(TxtSmoke[i][26], 1);
  374.  
  375.         TxtSmoke[i][27] = TextDrawCreate(550.764770, 315.083404, "LD_SPAC:white");
  376.         TextDrawLetterSize(TxtSmoke[i][27], 0.000000, 0.000000);
  377.         TextDrawTextSize(TxtSmoke[i][27], 56.470558, 15.750004);
  378.         TextDrawAlignment(TxtSmoke[i][27], 1);
  379.         TextDrawColor(TxtSmoke[i][27], -1);
  380.         TextDrawUseBox(TxtSmoke[i][27], true);
  381.         TextDrawBoxColor(TxtSmoke[i][27], 0);
  382.         TextDrawSetShadow(TxtSmoke[i][27], 0);
  383.         TextDrawSetOutline(TxtSmoke[i][27], 0);
  384.         TextDrawFont(TxtSmoke[i][27], 4);
  385.  
  386.         TxtSmoke[i][28] = TextDrawCreate(547.764648, 285.250000, "Original Red");
  387.         TextDrawLetterSize(TxtSmoke[i][28], 0.222235, 1.092498);
  388.         TextDrawAlignment(TxtSmoke[i][28], 1);
  389.         TextDrawColor(TxtSmoke[i][28], 255);
  390.         TextDrawSetShadow(TxtSmoke[i][28], 0);
  391.         TextDrawSetOutline(TxtSmoke[i][28], 0);
  392.         TextDrawBackgroundColor(TxtSmoke[i][28], 255);
  393.         TextDrawFont(TxtSmoke[i][28], 2);
  394.         TextDrawSetProportional(TxtSmoke[i][28], 1);
  395.  
  396.         TxtSmoke[i][29] = TextDrawCreate(579.411926, 312.333435, "Bafore13");
  397.         TextDrawLetterSize(TxtSmoke[i][29], 0.273529, 2.206667);
  398.         TextDrawTextSize(TxtSmoke[i][29], 0.000000, 17.500000);
  399.         TextDrawAlignment(TxtSmoke[i][29], 2);
  400.         TextDrawColor(TxtSmoke[i][29], 255);
  401.         TextDrawUseBox(TxtSmoke[i][29], true);
  402.         TextDrawBoxColor(TxtSmoke[i][29], 0);
  403.         TextDrawSetShadow(TxtSmoke[i][29], 0);
  404.         TextDrawSetOutline(TxtSmoke[i][29], 0);
  405.         TextDrawBackgroundColor(TxtSmoke[i][29], 255);
  406.         TextDrawFont(TxtSmoke[i][29], 2);
  407.         TextDrawSetProportional(TxtSmoke[i][29], 1);
  408.        
  409.         TextDrawSetSelectable(TxtSmoke[i][25], true);
  410.        
  411.         TextDrawSetSelectable(TxtSmoke[i][1], true);//Cigarro 1
  412.         TextDrawSetSelectable(TxtSmoke[i][3], true);//Cigarro 2
  413.         TextDrawSetSelectable(TxtSmoke[i][4], true);//Cigarro 3
  414.         TextDrawSetSelectable(TxtSmoke[i][5], true);//Cigarro 4
  415.         TextDrawSetSelectable(TxtSmoke[i][6], true);//Cigarro 5
  416.     }
  417.     return 1;
  418. }
  419.  
  420. public OnPlayerConnect(playerid)
  421. {
  422.     AbriuCarteira[playerid] = false;
  423.     FumandoCigarro[playerid] = false;
  424.     new arquivo[34];
  425.     format(arquivo, sizeof(arquivo), "Bafore13/%s.ini", Nome(playerid));
  426.     if(!DOF2_FileExists(arquivo))
  427.     {
  428.         DOF2_CreateFile(arquivo);
  429.         DOF2_SetBool(arquivo, "Cigarro1", false);
  430.         DOF2_SetBool(arquivo, "Cigarro2", false);
  431.         DOF2_SetBool(arquivo, "Cigarro3", false);
  432.         DOF2_SetBool(arquivo, "Cigarro4", false);
  433.         DOF2_SetBool(arquivo, "Cigarro5", false);
  434.     }
  435.     else
  436.     {
  437.         Cigarros[playerid][0] = DOF2_GetBool(arquivo, "Cigarro1");
  438.         Cigarros[playerid][1] = DOF2_GetBool(arquivo, "Cigarro2");
  439.         Cigarros[playerid][2] = DOF2_GetBool(arquivo, "Cigarro3");
  440.         Cigarros[playerid][3] = DOF2_GetBool(arquivo, "Cigarro4");
  441.         Cigarros[playerid][4] = DOF2_GetBool(arquivo, "Cigarro5");
  442.     }
  443.    
  444.     DOF2_SaveFile();
  445.     return 1;
  446. }
  447.  
  448. public OnPlayerDisconnect(playerid, reason)
  449. {
  450.     new arquivo[34];
  451.     format(arquivo, sizeof(arquivo), "Bafore13/%s.ini", Nome(playerid));
  452.     if(DOF2_FileExists(arquivo))
  453.     {
  454.         DOF2_SetBool(arquivo, "Cigarro1", Cigarros[playerid][0]);
  455.         DOF2_SetBool(arquivo, "Cigarro2", Cigarros[playerid][1]);
  456.         DOF2_SetBool(arquivo, "Cigarro3", Cigarros[playerid][2]);
  457.         DOF2_SetBool(arquivo, "Cigarro4", Cigarros[playerid][3]);
  458.         DOF2_SetBool(arquivo, "Cigarro5", Cigarros[playerid][4]);
  459.         DOF2_SaveFile();
  460.     }
  461.     return 1;
  462. }
  463.  
  464. public OnPlayerClickTextDraw(playerid, Text:clickedid)
  465. {
  466.     if(clickedid == TxtSmoke[playerid][25])
  467.     {
  468.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][15]);//capa
  469.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][16]);//borda vermelha em volta de "Cigarro"
  470.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][22]);//lista red em cima
  471.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][24]);//borda branca em volta de "Cigarro"
  472.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][26]);//Cigarro
  473.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][28]);//Original Red
  474.         TextDrawHideForPlayer(playerid, TxtSmoke[playerid][25]);//This clicavel
  475.        
  476.         if(Cigarros[playerid][0] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][1]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][2]);
  477.         if(Cigarros[playerid][1] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][3]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][7]);
  478.         if(Cigarros[playerid][2] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][4]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][8]);
  479.         if(Cigarros[playerid][3] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][5]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][9]);
  480.         if(Cigarros[playerid][4] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][6]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][10]);
  481.         SelectTextDraw(playerid, 0x808680FF);
  482.     }
  483.     if(clickedid == TxtSmoke[playerid][1])
  484.     {
  485.         Cigarros[playerid][0] = false;
  486.         SetCigarro(playerid); CancelSelectTextDraw(playerid);
  487.         for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
  488.     }
  489.     if(clickedid == TxtSmoke[playerid][3])
  490.     {
  491.         Cigarros[playerid][1] = false;
  492.         SetCigarro(playerid); CancelSelectTextDraw(playerid);
  493.         for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
  494.     }
  495.     if(clickedid == TxtSmoke[playerid][4])
  496.     {
  497.         Cigarros[playerid][2] = false;
  498.         SetCigarro(playerid); CancelSelectTextDraw(playerid);
  499.         for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
  500.     }
  501.     if(clickedid == TxtSmoke[playerid][5])
  502.     {
  503.         Cigarros[playerid][3] = false;
  504.         SetCigarro(playerid); CancelSelectTextDraw(playerid);
  505.         for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
  506.     }
  507.     if(clickedid == TxtSmoke[playerid][6])
  508.     {
  509.         Cigarros[playerid][4] = false;
  510.         SetCigarro(playerid); CancelSelectTextDraw(playerid);
  511.         for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
  512.     }
  513.     return 1;
  514. }
  515.  
  516. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  517. {
  518.     new SpecialAction = GetPlayerSpecialAction(playerid);
  519.     if(newkeys & KEY_FIRE && FumandoCigarro[playerid] == true && SpecialAction == SPECIAL_ACTION_SMOKE_CIGGY)
  520.     {
  521.         if(gettime() - TimeTragada[playerid] < 3) return 1;
  522.         new Float:Life; GetPlayerHealth(playerid, Life);
  523.         if(Tragadas[playerid] < 1)
  524.         {
  525.             SendClientMessage(playerid,COR_VERMELHO,"|Info| Seu cigarro terminou");
  526.             ClearAnimations(playerid);
  527.             SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  528.             KillTimer(TimerTC[playerid]);
  529.             FumandoCigarro[playerid] = false;
  530.             return 1;
  531.         }
  532.         else
  533.         {
  534.             TimeTragada[playerid] = gettime();
  535.             SetPlayerHealth(playerid, Life + 2.5);
  536.             Tragadas[playerid] --;
  537.         }
  538.         if(Life > 100) { SetPlayerHealth(playerid, 100.0); }
  539.     }
  540.  
  541.     if(newkeys == 16 && FumandoCigarro[playerid] == true)
  542.     {
  543.         new Float:Px, Float:Py, Float:Pz; GetPlayerPos(playerid, Px, Py, Pz);
  544.         for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerInRangeOfPoint(i, 10.0, Px, Py, Pz)) SendFormatMsg(i, COR_ROXOCLARO, "%s apaga seu cigarro", Nome(playerid));
  545.         ClearAnimations(playerid);
  546.         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  547.         KillTimer(TimerTC[playerid]);
  548.         FumandoCigarro[playerid] = false;
  549.     }
  550.    
  551.     return 1;
  552. }
  553.  
  554. forward TerminarCigarro(playerid);
  555. public TerminarCigarro(playerid)
  556. {
  557.     if(FumandoCigarro[playerid] == true)
  558.     {
  559.         SendClientMessage(playerid, COR_VERMELHO, "|Info| Seu cigarro terminou");
  560.         ClearAnimations(playerid);
  561.         SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
  562.         FumandoCigarro[playerid] = false;
  563.     }
  564.     return 1;
  565. }
  566.  
  567. //==================== | COMANDOS | ====================
  568. CMD:fumar(playerid)
  569. {
  570.     if(FumandoCigarro[playerid] == true) return SendClientMessage(playerid, COR_VERMELHO, "Você já acendeu um cigarro, para apagar tecle F");
  571.     if(AbriuCarteira[playerid] == true)
  572.     {
  573.         AbriuCarteira[playerid] = false; CancelSelectTextDraw(playerid);
  574.         for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
  575.         return 1;
  576.     }
  577.     SelectTextDraw(playerid, 0xFF0000AA); AbriuCarteira[playerid] = true;
  578.     for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][a]);
  579.     return 1;
  580. }
  581.  
  582. CMD:darcigarros(playerid, params[])
  583. {
  584.     new id, qnt;
  585.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_VERMELHO, "|Erro| Você não tem autorização para utilizar esse comando!");
  586.     if(sscanf(params,"id", id, qnt)) return SendClientMessage(playerid, -1, "Use: /darcigarros [id] [quantia]");
  587.     if(qnt < 1 || qnt > 5) return SendClientMessage(playerid, COR_VERMELHO, "|Erro| O número de cigarros deve estar em 1 e 5!");
  588.     if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_VERMELHO, "|Erro| Usuário não conectado");
  589.     SendFormatMsg(playerid, 0x00C2ECFF, "|Info| Você deu [%d] cigarros para %s", qnt, Nome(id));
  590.     SendFormatMsg(playerid, 0x00C2ECFF, "|Info| Você recebeu [%d] cigarros de %s, aproveite!", qnt, Nome(playerid));
  591.     DarCigarros(id, qnt); AtualizarCigarros(id);
  592.     return 1;
  593. }
Add Comment
Please, Sign In to add comment