Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=================== | INCLUDES | ====================
- #include <a_samp>
- #include <zcmd>
- #include <sscanf>
- #include <DOF2>
- //==================== | MACROS | =====================
- new stringf[100];
- #define SendFormatMsg(%0,%1,%2,%3) format(stringf, sizeof(stringf),%2,%3) && SendClientMessage(%0, %1, stringf)
- //==================== | DEFINES | ====================
- #define COR_ROXOCLARO 0xC2A2DAFF
- #define COR_VERMELHO 0xCD5C5CFF
- //=================== | VARIÁVEIS | ===================
- new Text:TxtSmoke[MAX_PLAYERS][30];
- new bool:Cigarros[MAX_PLAYERS][5];
- new bool:AbriuCarteira[MAX_PLAYERS] = false;
- new bool:FumandoCigarro[MAX_PLAYERS] = false;
- new Tragadas[MAX_PLAYERS];
- new TimeTragada[MAX_PLAYERS];
- new TimerTC[MAX_PLAYERS];
- //==================== | FUNÇÕES | ====================
- Nome(playerid)
- {
- new name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- return name;
- }
- stock SetCigarro(playerid)
- {
- new Float:Px, Float:Py, Float:Pz; GetPlayerPos(playerid, Px, Py, Pz);
- AbriuCarteira[playerid] = false;
- FumandoCigarro[playerid] = true;
- Tragadas[playerid] = 6;
- SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
- 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));
- TimerTC[playerid] = SetTimerEx("TerminarCigarro", 60000, false, "i", playerid);
- return 1;
- }
- stock AtualizarCigarros(playerid)
- {
- if(AbriuCarteira[playerid] == false) return 1;
- if(Cigarros[playerid][0] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][1]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][2]);
- if(Cigarros[playerid][1] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][3]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][7]);
- if(Cigarros[playerid][2] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][4]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][8]);
- if(Cigarros[playerid][3] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][5]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][9]);
- if(Cigarros[playerid][4] == true) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][6]), TextDrawShowForPlayer(playerid, TxtSmoke[playerid][10]);
- return 1;
- }
- stock DarCigarros(playerid, quantia)
- {
- new contar[MAX_PLAYERS] = 0;
- if(Cigarros[playerid][0] == false)
- {
- Cigarros[playerid][0] = true;
- contar[playerid] ++;
- if(contar[playerid] == quantia) return 1;
- }
- if(Cigarros[playerid][1] == false)
- {
- Cigarros[playerid][1] = true;
- contar[playerid] ++;
- if(contar[playerid] == quantia) return 1;
- }
- if(Cigarros[playerid][2] == false)
- {
- Cigarros[playerid][2] = true;
- contar[playerid] ++;
- if(contar[playerid] == quantia) return 1;
- }
- if(Cigarros[playerid][3] == false)
- {
- Cigarros[playerid][3] = true;
- contar[playerid] ++;
- if(contar[playerid] == quantia) return 1;
- }
- if(Cigarros[playerid][4] == false)
- {
- Cigarros[playerid][4] = true;
- contar[playerid] ++;
- if(contar[playerid] == quantia) return 1;
- }
- return 1;
- }
- //================== | CALLBACKS | ====================
- public OnFilterScriptInit()
- {
- print(" Bafore13 Carregado!");
- for (new i = 0; i < GetMaxPlayers(); i++)
- {
- TxtSmoke[i][0] = TextDrawCreate(631.529418, 435.166687, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][0], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][0], -105.882385, -173.250000);
- TextDrawAlignment(TxtSmoke[i][0], 1);
- TextDrawColor(TxtSmoke[i][0], -1);
- TextDrawSetShadow(TxtSmoke[i][0], 0);
- TextDrawSetOutline(TxtSmoke[i][0], 0);
- TextDrawFont(TxtSmoke[i][0], 4);
- TxtSmoke[i][1] = TextDrawCreate(538.058715, 267.833312, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][1], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][1], 10.352966, 38.333312);//10.352966, 121.333312
- TextDrawAlignment(TxtSmoke[i][1], 1);
- TextDrawColor(TxtSmoke[i][1], -1974466817);
- TextDrawSetShadow(TxtSmoke[i][1], 0);
- TextDrawSetOutline(TxtSmoke[i][1], 0);
- TextDrawFont(TxtSmoke[i][1], 4);
- TextDrawUseBox(TxtSmoke[i][1], 1);
- TextDrawBoxColor(TxtSmoke[i][1], -256);
- TxtSmoke[i][2] = TextDrawCreate(537.763977, 266.166473, "LD_POOL:ball");
- TextDrawLetterSize(TxtSmoke[i][2], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][2], 10.823541, 4.083354);
- TextDrawAlignment(TxtSmoke[i][2], 1);
- TextDrawColor(TxtSmoke[i][2], -2138668801);
- TextDrawSetShadow(TxtSmoke[i][2], 0);
- TextDrawSetOutline(TxtSmoke[i][2], 0);
- TextDrawFont(TxtSmoke[i][2], 4);
- TxtSmoke[i][3] = TextDrawCreate(555.999633, 268.833343, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][3], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][3], 10.352966, 38.333312);//121.333312
- TextDrawAlignment(TxtSmoke[i][3], 1);
- TextDrawColor(TxtSmoke[i][3], -1974466817);
- TextDrawSetShadow(TxtSmoke[i][3], 0);
- TextDrawSetOutline(TxtSmoke[i][3], 0);
- TextDrawFont(TxtSmoke[i][3], 4);
- TextDrawUseBox(TxtSmoke[i][3], 1);
- TextDrawBoxColor(TxtSmoke[i][3], -256);
- TxtSmoke[i][4] = TextDrawCreate(573.940979, 268.666656, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][4], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][4], 10.352966, 38.333312);
- TextDrawAlignment(TxtSmoke[i][4], 1);
- TextDrawColor(TxtSmoke[i][4], -1974466817);
- TextDrawSetShadow(TxtSmoke[i][4], 0);
- TextDrawSetOutline(TxtSmoke[i][4], 0);
- TextDrawFont(TxtSmoke[i][4], 4);
- TextDrawUseBox(TxtSmoke[i][4], 1);
- TextDrawBoxColor(TxtSmoke[i][4], -256);
- TxtSmoke[i][5] = TextDrawCreate(590.529296, 268.333282, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][5], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][5], 10.352966, 38.333312);
- TextDrawAlignment(TxtSmoke[i][5], 1);
- TextDrawColor(TxtSmoke[i][5], -1974466817);
- TextDrawSetShadow(TxtSmoke[i][5], 0);
- TextDrawSetOutline(TxtSmoke[i][5], 0);
- TextDrawFont(TxtSmoke[i][5], 4);
- TextDrawUseBox(TxtSmoke[i][5], 1);
- TextDrawBoxColor(TxtSmoke[i][5], -256);
- TxtSmoke[i][6] = TextDrawCreate(607.411499, 268.499969, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][6], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][6], 10.352966, 38.333312);
- TextDrawAlignment(TxtSmoke[i][6], 1);
- TextDrawColor(TxtSmoke[i][6], -1974466817);
- TextDrawSetShadow(TxtSmoke[i][6], 0);
- TextDrawSetOutline(TxtSmoke[i][6], 0);
- TextDrawFont(TxtSmoke[i][6], 4);
- TextDrawUseBox(TxtSmoke[i][6], 1);
- TextDrawBoxColor(TxtSmoke[i][6], -256);
- TxtSmoke[i][7] = TextDrawCreate(555.705017, 265.999847, "LD_POOL:ball");
- TextDrawLetterSize(TxtSmoke[i][7], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][7], 10.823541, 4.083354);
- TextDrawAlignment(TxtSmoke[i][7], 1);
- TextDrawColor(TxtSmoke[i][7], -2138668801);
- TextDrawSetShadow(TxtSmoke[i][7], 0);
- TextDrawSetOutline(TxtSmoke[i][7], 0);
- TextDrawFont(TxtSmoke[i][7], 4);
- TextDrawSetPreviewModel(TxtSmoke[i][7], 3044);
- TextDrawSetPreviewRot(TxtSmoke[i][7], 352.000000, 240.000000, 0.000000, 0.000000);
- TxtSmoke[i][8] = TextDrawCreate(573.646118, 265.833160, "LD_POOL:ball");
- TextDrawLetterSize(TxtSmoke[i][8], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][8], 10.823541, 4.083354);
- TextDrawAlignment(TxtSmoke[i][8], 1);
- TextDrawColor(TxtSmoke[i][8], -2138668801);
- TextDrawSetShadow(TxtSmoke[i][8], 0);
- TextDrawSetOutline(TxtSmoke[i][8], 0);
- TextDrawFont(TxtSmoke[i][8], 4);
- TextDrawSetPreviewModel(TxtSmoke[i][8], 3044);
- TextDrawSetPreviewRot(TxtSmoke[i][8], 352.000000, 240.000000, 0.000000, 0.000000);
- TxtSmoke[i][9] = TextDrawCreate(590.175292, 265.666503, "LD_POOL:ball");
- TextDrawLetterSize(TxtSmoke[i][9], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][9], 10.823541, 4.083354);
- TextDrawAlignment(TxtSmoke[i][9], 1);
- TextDrawColor(TxtSmoke[i][9], -2138668801);
- TextDrawSetShadow(TxtSmoke[i][9], 0);
- TextDrawSetOutline(TxtSmoke[i][9], 0);
- TextDrawFont(TxtSmoke[i][9], 4);
- TextDrawSetPreviewModel(TxtSmoke[i][9], 3044);
- TextDrawSetPreviewRot(TxtSmoke[i][9], 352.000000, 240.000000, 0.000000, 0.000000);
- TxtSmoke[i][10] = TextDrawCreate(607.175231, 266.083129, "LD_POOL:ball");
- TextDrawLetterSize(TxtSmoke[i][10], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][10], 10.823541, 4.083354);
- TextDrawAlignment(TxtSmoke[i][10], 1);
- TextDrawColor(TxtSmoke[i][10], -2138668801);
- TextDrawSetShadow(TxtSmoke[i][10], 0);
- TextDrawSetOutline(TxtSmoke[i][10], 0);
- TextDrawFont(TxtSmoke[i][10], 4);
- TextDrawSetPreviewModel(TxtSmoke[i][10], 3044);
- TextDrawSetPreviewRot(TxtSmoke[i][10], 352.000000, 240.000000, 0.000000, 0.000000);
- TxtSmoke[i][11] = TextDrawCreate(525.647033, 261.916351, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][11], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][11], 9.411779, 46.083328);
- TextDrawAlignment(TxtSmoke[i][11], 1);
- TextDrawColor(TxtSmoke[i][11], 8388863);
- TextDrawSetShadow(TxtSmoke[i][11], 0);
- TextDrawSetOutline(TxtSmoke[i][11], 0);
- TextDrawFont(TxtSmoke[i][11], 4);
- TxtSmoke[i][12] = TextDrawCreate(621.705688, 261.749908, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][12], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][12], 9.411779, 46.083316);
- TextDrawAlignment(TxtSmoke[i][12], 1);
- TextDrawColor(TxtSmoke[i][12], 8388863);
- TextDrawSetShadow(TxtSmoke[i][12], 0);
- TextDrawSetOutline(TxtSmoke[i][12], 0);
- TextDrawFont(TxtSmoke[i][12], 4);
- TxtSmoke[i][13] = TextDrawCreate(525.294006, 304.166534, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][13], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][13], 105.882408, 123.083358);
- TextDrawAlignment(TxtSmoke[i][13], 1);
- TextDrawColor(TxtSmoke[i][13], 8388863);
- TextDrawSetShadow(TxtSmoke[i][13], 0);
- TextDrawSetOutline(TxtSmoke[i][13], 0);
- TextDrawFont(TxtSmoke[i][13], 4);
- TxtSmoke[i][14] = TextDrawCreate(525.647033, 315.583312, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][14], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][14], 105.882392, 119.583343);
- TextDrawAlignment(TxtSmoke[i][14], 1);
- TextDrawColor(TxtSmoke[i][14], -1);
- TextDrawSetShadow(TxtSmoke[i][14], 0);
- TextDrawSetOutline(TxtSmoke[i][14], 0);
- TextDrawFont(TxtSmoke[i][14], 4);
- TxtSmoke[i][15] = TextDrawCreate(525.235412, 261.749847, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][15], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][15], 105.882392, 51.916645);
- TextDrawAlignment(TxtSmoke[i][15], 1);
- TextDrawColor(TxtSmoke[i][15], -1);
- TextDrawSetShadow(TxtSmoke[i][15], 0);
- TextDrawSetOutline(TxtSmoke[i][15], 0);
- TextDrawFont(TxtSmoke[i][15], 4);
- TextDrawUseBox(TxtSmoke[i][15], 1);
- TextDrawBoxColor(TxtSmoke[i][15], -256);
- TxtSmoke[i][16] = TextDrawCreate(549.176452, 299.833312, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][16], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][16], 60.235252, 14.000003);
- TextDrawAlignment(TxtSmoke[i][16], 1);
- TextDrawColor(TxtSmoke[i][16], -16776961);
- TextDrawUseBox(TxtSmoke[i][16], true);
- TextDrawBoxColor(TxtSmoke[i][16], 0);
- TextDrawSetShadow(TxtSmoke[i][16], 0);
- TextDrawSetOutline(TxtSmoke[i][16], 0);
- TextDrawFont(TxtSmoke[i][16], 4);
- TxtSmoke[i][17] = TextDrawCreate(528.000000, 343.000030, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][17], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][17], 101.176467, 89.250022);
- TextDrawAlignment(TxtSmoke[i][17], 1);
- TextDrawColor(TxtSmoke[i][17], 255);
- TextDrawSetShadow(TxtSmoke[i][17], 0);
- TextDrawSetOutline(TxtSmoke[i][17], 0);
- TextDrawFont(TxtSmoke[i][17], 4);
- TxtSmoke[i][18] = TextDrawCreate(531.823486, 349.250122, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][18], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][18], 91.764694, 77.000022);
- TextDrawAlignment(TxtSmoke[i][18], 1);
- TextDrawColor(TxtSmoke[i][18], -1);
- TextDrawUseBox(TxtSmoke[i][18], true);
- TextDrawBoxColor(TxtSmoke[i][18], 0);
- TextDrawSetShadow(TxtSmoke[i][18], 0);
- TextDrawSetOutline(TxtSmoke[i][18], 0);
- TextDrawFont(TxtSmoke[i][18], 4);
- TxtSmoke[i][19] = TextDrawCreate(546.823242, 358.166687, "Fumar");
- TextDrawLetterSize(TxtSmoke[i][19], 0.449999, 1.600000);
- TextDrawAlignment(TxtSmoke[i][19], 1);
- TextDrawColor(TxtSmoke[i][19], -1);
- TextDrawUseBox(TxtSmoke[i][19], true);
- TextDrawBoxColor(TxtSmoke[i][19], 0);
- TextDrawSetShadow(TxtSmoke[i][19], 0);
- TextDrawSetOutline(TxtSmoke[i][19], 1);
- TextDrawBackgroundColor(TxtSmoke[i][19], 255);
- TextDrawFont(TxtSmoke[i][19], 2);
- TextDrawSetProportional(TxtSmoke[i][19], 1);
- TxtSmoke[i][20] = TextDrawCreate(552.529235, 395.917053, "Mata");
- TextDrawLetterSize(TxtSmoke[i][20], 0.449999, 1.600000);
- TextDrawAlignment(TxtSmoke[i][20], 1);
- TextDrawColor(TxtSmoke[i][20], -1);
- TextDrawUseBox(TxtSmoke[i][20], true);
- TextDrawBoxColor(TxtSmoke[i][20], 0);
- TextDrawSetShadow(TxtSmoke[i][20], 0);
- TextDrawSetOutline(TxtSmoke[i][20], 1);
- TextDrawBackgroundColor(TxtSmoke[i][20], 255);
- TextDrawFont(TxtSmoke[i][20], 2);
- TextDrawSetProportional(TxtSmoke[i][20], 1);
- TxtSmoke[i][21] = TextDrawCreate(564.235961, 371.583251, "LD_TATT:9homby");
- TextDrawLetterSize(TxtSmoke[i][21], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][21], 30.588249, 29.166631);
- TextDrawAlignment(TxtSmoke[i][21], 1);
- TextDrawColor(TxtSmoke[i][21], -1);
- TextDrawSetShadow(TxtSmoke[i][21], 0);
- TextDrawSetOutline(TxtSmoke[i][21], 0);
- TextDrawFont(TxtSmoke[i][21], 4);
- TxtSmoke[i][22] = TextDrawCreate(631.529418, 261.916717, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][22], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][22], -105.882369, 2.333314);
- TextDrawAlignment(TxtSmoke[i][22], 1);
- TextDrawColor(TxtSmoke[i][22], -16776961);
- TextDrawUseBox(TxtSmoke[i][22], true);
- TextDrawBoxColor(TxtSmoke[i][22], 0);
- TextDrawSetShadow(TxtSmoke[i][22], 0);
- TextDrawSetOutline(TxtSmoke[i][22], 0);
- TextDrawFont(TxtSmoke[i][22], 4);
- TxtSmoke[i][23] = TextDrawCreate(548.764770, 315.416595, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][23], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][23], 60.235267, 18.083335);
- TextDrawAlignment(TxtSmoke[i][23], 1);
- TextDrawColor(TxtSmoke[i][23], -16776961);
- TextDrawSetShadow(TxtSmoke[i][23], 0);
- TextDrawSetOutline(TxtSmoke[i][23], 0);
- TextDrawFont(TxtSmoke[i][23], 4);
- TxtSmoke[i][24] = TextDrawCreate(550.705932, 301.833282, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][24], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][24], 56.470558, 11.666671);
- TextDrawAlignment(TxtSmoke[i][24], 1);
- TextDrawColor(TxtSmoke[i][24], -1);
- TextDrawSetShadow(TxtSmoke[i][24], 0);
- TextDrawSetOutline(TxtSmoke[i][24], 0);
- TextDrawFont(TxtSmoke[i][24], 4);/**/
- TxtSmoke[i][25] = TextDrawCreate(525.235412, 261.749847, "LD_SPAC:white");//movido
- TextDrawLetterSize(TxtSmoke[i][25], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][25], 105.882392, 51.916645);
- TextDrawColor(TxtSmoke[i][25], -256);
- TextDrawFont(TxtSmoke[i][25], 4);
- TextDrawUseBox(TxtSmoke[i][25], 1);
- TextDrawBoxColor(TxtSmoke[i][25], -256);
- TxtSmoke[i][26] = TextDrawCreate(562.941406, 300.083465, "Cigarro");
- TextDrawLetterSize(TxtSmoke[i][26], 0.374706, 1.360832);
- TextDrawTextSize(TxtSmoke[i][26], 0.000000, -18.083333);
- TextDrawAlignment(TxtSmoke[i][26], 1);
- TextDrawColor(TxtSmoke[i][26], 255);
- TextDrawUseBox(TxtSmoke[i][26], true);
- TextDrawBoxColor(TxtSmoke[i][26], 0);
- TextDrawSetShadow(TxtSmoke[i][26], 0);
- TextDrawSetOutline(TxtSmoke[i][26], 0);
- TextDrawBackgroundColor(TxtSmoke[i][26], 255);
- TextDrawFont(TxtSmoke[i][26], 0);
- TextDrawSetProportional(TxtSmoke[i][26], 1);
- TxtSmoke[i][27] = TextDrawCreate(550.764770, 315.083404, "LD_SPAC:white");
- TextDrawLetterSize(TxtSmoke[i][27], 0.000000, 0.000000);
- TextDrawTextSize(TxtSmoke[i][27], 56.470558, 15.750004);
- TextDrawAlignment(TxtSmoke[i][27], 1);
- TextDrawColor(TxtSmoke[i][27], -1);
- TextDrawUseBox(TxtSmoke[i][27], true);
- TextDrawBoxColor(TxtSmoke[i][27], 0);
- TextDrawSetShadow(TxtSmoke[i][27], 0);
- TextDrawSetOutline(TxtSmoke[i][27], 0);
- TextDrawFont(TxtSmoke[i][27], 4);
- TxtSmoke[i][28] = TextDrawCreate(547.764648, 285.250000, "Original Red");
- TextDrawLetterSize(TxtSmoke[i][28], 0.222235, 1.092498);
- TextDrawAlignment(TxtSmoke[i][28], 1);
- TextDrawColor(TxtSmoke[i][28], 255);
- TextDrawSetShadow(TxtSmoke[i][28], 0);
- TextDrawSetOutline(TxtSmoke[i][28], 0);
- TextDrawBackgroundColor(TxtSmoke[i][28], 255);
- TextDrawFont(TxtSmoke[i][28], 2);
- TextDrawSetProportional(TxtSmoke[i][28], 1);
- TxtSmoke[i][29] = TextDrawCreate(579.411926, 312.333435, "Bafore13");
- TextDrawLetterSize(TxtSmoke[i][29], 0.273529, 2.206667);
- TextDrawTextSize(TxtSmoke[i][29], 0.000000, 17.500000);
- TextDrawAlignment(TxtSmoke[i][29], 2);
- TextDrawColor(TxtSmoke[i][29], 255);
- TextDrawUseBox(TxtSmoke[i][29], true);
- TextDrawBoxColor(TxtSmoke[i][29], 0);
- TextDrawSetShadow(TxtSmoke[i][29], 0);
- TextDrawSetOutline(TxtSmoke[i][29], 0);
- TextDrawBackgroundColor(TxtSmoke[i][29], 255);
- TextDrawFont(TxtSmoke[i][29], 2);
- TextDrawSetProportional(TxtSmoke[i][29], 1);
- TextDrawSetSelectable(TxtSmoke[i][25], true);
- TextDrawSetSelectable(TxtSmoke[i][1], true);//Cigarro 1
- TextDrawSetSelectable(TxtSmoke[i][3], true);//Cigarro 2
- TextDrawSetSelectable(TxtSmoke[i][4], true);//Cigarro 3
- TextDrawSetSelectable(TxtSmoke[i][5], true);//Cigarro 4
- TextDrawSetSelectable(TxtSmoke[i][6], true);//Cigarro 5
- }
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- AbriuCarteira[playerid] = false;
- FumandoCigarro[playerid] = false;
- new arquivo[34];
- format(arquivo, sizeof(arquivo), "Bafore13/%s.ini", Nome(playerid));
- if(!DOF2_FileExists(arquivo))
- {
- DOF2_CreateFile(arquivo);
- DOF2_SetBool(arquivo, "Cigarro1", false);
- DOF2_SetBool(arquivo, "Cigarro2", false);
- DOF2_SetBool(arquivo, "Cigarro3", false);
- DOF2_SetBool(arquivo, "Cigarro4", false);
- DOF2_SetBool(arquivo, "Cigarro5", false);
- }
- else
- {
- Cigarros[playerid][0] = DOF2_GetBool(arquivo, "Cigarro1");
- Cigarros[playerid][1] = DOF2_GetBool(arquivo, "Cigarro2");
- Cigarros[playerid][2] = DOF2_GetBool(arquivo, "Cigarro3");
- Cigarros[playerid][3] = DOF2_GetBool(arquivo, "Cigarro4");
- Cigarros[playerid][4] = DOF2_GetBool(arquivo, "Cigarro5");
- }
- DOF2_SaveFile();
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new arquivo[34];
- format(arquivo, sizeof(arquivo), "Bafore13/%s.ini", Nome(playerid));
- if(DOF2_FileExists(arquivo))
- {
- DOF2_SetBool(arquivo, "Cigarro1", Cigarros[playerid][0]);
- DOF2_SetBool(arquivo, "Cigarro2", Cigarros[playerid][1]);
- DOF2_SetBool(arquivo, "Cigarro3", Cigarros[playerid][2]);
- DOF2_SetBool(arquivo, "Cigarro4", Cigarros[playerid][3]);
- DOF2_SetBool(arquivo, "Cigarro5", Cigarros[playerid][4]);
- DOF2_SaveFile();
- }
- return 1;
- }
- public OnPlayerClickTextDraw(playerid, Text:clickedid)
- {
- if(clickedid == TxtSmoke[playerid][25])
- {
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][15]);//capa
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][16]);//borda vermelha em volta de "Cigarro"
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][22]);//lista red em cima
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][24]);//borda branca em volta de "Cigarro"
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][26]);//Cigarro
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][28]);//Original Red
- TextDrawHideForPlayer(playerid, TxtSmoke[playerid][25]);//This clicavel
- if(Cigarros[playerid][0] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][1]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][2]);
- if(Cigarros[playerid][1] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][3]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][7]);
- if(Cigarros[playerid][2] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][4]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][8]);
- if(Cigarros[playerid][3] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][5]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][9]);
- if(Cigarros[playerid][4] == false) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][6]), TextDrawHideForPlayer(playerid, TxtSmoke[playerid][10]);
- SelectTextDraw(playerid, 0x808680FF);
- }
- if(clickedid == TxtSmoke[playerid][1])
- {
- Cigarros[playerid][0] = false;
- SetCigarro(playerid); CancelSelectTextDraw(playerid);
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
- }
- if(clickedid == TxtSmoke[playerid][3])
- {
- Cigarros[playerid][1] = false;
- SetCigarro(playerid); CancelSelectTextDraw(playerid);
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
- }
- if(clickedid == TxtSmoke[playerid][4])
- {
- Cigarros[playerid][2] = false;
- SetCigarro(playerid); CancelSelectTextDraw(playerid);
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
- }
- if(clickedid == TxtSmoke[playerid][5])
- {
- Cigarros[playerid][3] = false;
- SetCigarro(playerid); CancelSelectTextDraw(playerid);
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
- }
- if(clickedid == TxtSmoke[playerid][6])
- {
- Cigarros[playerid][4] = false;
- SetCigarro(playerid); CancelSelectTextDraw(playerid);
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- new SpecialAction = GetPlayerSpecialAction(playerid);
- if(newkeys & KEY_FIRE && FumandoCigarro[playerid] == true && SpecialAction == SPECIAL_ACTION_SMOKE_CIGGY)
- {
- if(gettime() - TimeTragada[playerid] < 3) return 1;
- new Float:Life; GetPlayerHealth(playerid, Life);
- if(Tragadas[playerid] < 1)
- {
- SendClientMessage(playerid,COR_VERMELHO,"|Info| Seu cigarro terminou");
- ClearAnimations(playerid);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- KillTimer(TimerTC[playerid]);
- FumandoCigarro[playerid] = false;
- return 1;
- }
- else
- {
- TimeTragada[playerid] = gettime();
- SetPlayerHealth(playerid, Life + 2.5);
- Tragadas[playerid] --;
- }
- if(Life > 100) { SetPlayerHealth(playerid, 100.0); }
- }
- if(newkeys == 16 && FumandoCigarro[playerid] == true)
- {
- new Float:Px, Float:Py, Float:Pz; GetPlayerPos(playerid, Px, Py, Pz);
- 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));
- ClearAnimations(playerid);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- KillTimer(TimerTC[playerid]);
- FumandoCigarro[playerid] = false;
- }
- return 1;
- }
- forward TerminarCigarro(playerid);
- public TerminarCigarro(playerid)
- {
- if(FumandoCigarro[playerid] == true)
- {
- SendClientMessage(playerid, COR_VERMELHO, "|Info| Seu cigarro terminou");
- ClearAnimations(playerid);
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE);
- FumandoCigarro[playerid] = false;
- }
- return 1;
- }
- //==================== | COMANDOS | ====================
- CMD:fumar(playerid)
- {
- if(FumandoCigarro[playerid] == true) return SendClientMessage(playerid, COR_VERMELHO, "Você já acendeu um cigarro, para apagar tecle F");
- if(AbriuCarteira[playerid] == true)
- {
- AbriuCarteira[playerid] = false; CancelSelectTextDraw(playerid);
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawHideForPlayer(playerid, TxtSmoke[playerid][a]);
- return 1;
- }
- SelectTextDraw(playerid, 0xFF0000AA); AbriuCarteira[playerid] = true;
- for(new a = 0; a != sizeof(TxtSmoke); a++) TextDrawShowForPlayer(playerid, TxtSmoke[playerid][a]);
- return 1;
- }
- CMD:darcigarros(playerid, params[])
- {
- new id, qnt;
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_VERMELHO, "|Erro| Você não tem autorização para utilizar esse comando!");
- if(sscanf(params,"id", id, qnt)) return SendClientMessage(playerid, -1, "Use: /darcigarros [id] [quantia]");
- if(qnt < 1 || qnt > 5) return SendClientMessage(playerid, COR_VERMELHO, "|Erro| O número de cigarros deve estar em 1 e 5!");
- if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_VERMELHO, "|Erro| Usuário não conectado");
- SendFormatMsg(playerid, 0x00C2ECFF, "|Info| Você deu [%d] cigarros para %s", qnt, Nome(id));
- SendFormatMsg(playerid, 0x00C2ECFF, "|Info| Você recebeu [%d] cigarros de %s, aproveite!", qnt, Nome(playerid));
- DarCigarros(id, qnt); AtualizarCigarros(id);
- return 1;
- }
Add Comment
Please, Sign In to add comment