Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <dudb>
- #include <dini>
- #define DIALOG_DROGAS 230
- #define DIALOG_QUANTIAM 231
- #define DIALOG_QUANTIAC 232
- #define DIALOG_QUANTIACC 233
- #define DIALOG_ESCOLHERDROGAS 234
- #pragma tabsize 0
- #define Amarelo 0xFFFF00FF
- #define Vermelho 0xAA3333AA
- #define Branco 0xFFFFFFAA
- #define Verde 0x33AA33AA
- #define Preto 0x00000000
- #define Azul 0x33CCFFAA
- #define Violeta 0x9955DEEE
- #define Cinza 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xAA3333AA
- #define COLOR_WHITE 0xFFFFFFAA
- new pMaconha[MAX_PLAYERS];
- new pCrack[MAX_PLAYERS];
- new pCocaina[MAX_PLAYERS];
- forward FicarNormal(playerid);
- new PickupMorroLS;
- //forward FumandoMaconha(playerid);
- //forward FumandoCrack(playerid);
- //forward CheirandoCocaína(playerid);
- public OnFilterScriptInit()
- {
- print("\n======================================");
- print(" Sistema de Drogas bY RaFaeL[DL](faeldk)");
- print("======================================\n");
- PickupMorroLS = CreatePickup(1279, 1, 2176.8103,-984.8187,64.4688);
- Create3DTextLabel("Boca de Drogas [LS]",0xFFFF00AA,2176.8103,-984.8187,64.4688,50.0,0,0);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- main()
- {
- print("\n======================================");
- print(" Sistema de Drogas bY RaFaeL[DL](faeldk)");
- print("======================================\n");
- }
- public OnPlayerConnect(playerid)
- {
- pMaconha[playerid] = 0;
- pCocaina[playerid] = 0;
- pCrack[playerid] = 0;
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- pMaconha[playerid] = 0;
- pCocaina[playerid] = 0;
- pCrack[playerid] = 0;
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- ApplyAnimation(playerid, "CRACK", "crckdeth2",4.1,1,1,1,1,1);
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/comprardrogas", cmdtext, true, 10) == 0)
- {
- if (IsPlayerInRangeOfPoint(playerid,5.0,2176.8103,-984.8187,64.4688))
- {
- ShowPlayerDialog(playerid, DIALOG_DROGAS, DIALOG_STYLE_LIST, "Menu de Drogas", "Maconha\nCrack\nCocaína", "Selecionar", "Cancelar");
- }
- else SendClientMessage(playerid,0xFFFF00AA,"Você não está no ponto de Drogas");
- return 1;
- }
- if (strcmp("/usardrogas", cmdtext, true, 10) == 0)
- {
- if (pMaconha[playerid] >= 1 || pCrack[playerid] >= 1 || pCocaina[playerid] >= 1)
- {
- pMaconha[playerid]--;
- ShowPlayerDialog(playerid, DIALOG_ESCOLHERDROGAS, DIALOG_STYLE_LIST, "Escolha a Droga que quer usar", "Maconha\nCrack\nCocaína", "Selecionar", "Cancelar");
- }
- else SendClientMessage(playerid,0xFFFF00AA,"Você não tem drogas.");
- return 1;
- }
- return 0;
- }
- public OnPlayerPickUpPickup(playerid, pickupid) {
- if(pickupid == PickupMorroLS) {
- GameTextForPlayer(playerid,"~w~Use ~r~/comprardrogas", 3000,1);
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_DROGAS) // Menu
- {
- if(response)
- {
- if(listitem == 0) // maconha
- {
- ShowPlayerDialog(playerid,DIALOG_QUANTIAM,DIALOG_STYLE_INPUT,"Maconha - Digite a Quantidade","Digite a quantidade de Drogas abaixo:","Comprar","Sair");
- }
- if(listitem == 1) // crack
- {
- ShowPlayerDialog(playerid,DIALOG_QUANTIAC,DIALOG_STYLE_INPUT,"Crack - Digite a Quantidade","Digite a quantidade de Drogas abaixo:","Comprar","Sair");
- }
- if(listitem == 2) // cOCAÍNA
- {
- ShowPlayerDialog(playerid,DIALOG_QUANTIACC,DIALOG_STYLE_INPUT,"Cocaína - Digite a Quantidade","Digite a quantidade de Drogas abaixo:","Comprar","Sair");
- }
- }
- return 1;
- }
- if(dialogid == DIALOG_QUANTIAM)
- {
- if(!response)
- return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de Drogas");
- if(!strval(inputtext))
- return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de drogas");
- if(strval(inputtext) < 0 || strval(inputtext) > 299)
- return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] quantia Invalida");
- pMaconha[playerid] = strval(inputtext);
- SendClientMessage(playerid, 0xFFFFFFFF,"Você Comprou Maconha");
- GivePlayerMoney(playerid,strval(inputtext)*10);
- return 1;
- }
- if(dialogid == DIALOG_QUANTIAC)
- {
- if(!response)
- return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de Drogas");
- if(!strval(inputtext))
- return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de drogas");
- if(strval(inputtext) < 0 || strval(inputtext) > 299)
- return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] quantia Invalida");
- pCrack[playerid] = strval(inputtext);
- SendClientMessage(playerid, 0xFFFFFFFF,"Você Comprou Crack");
- GivePlayerMoney(playerid,strval(inputtext)*10);
- return 1;
- }
- if(dialogid == DIALOG_QUANTIACC)
- {
- if(!response)
- return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de Drogas");
- if(!strval(inputtext))
- return SendClientMessage(playerid, 0xFFFFFFFF, "Você cancelou a compra de drogas");
- if(strval(inputtext) < 0 || strval(inputtext) > 299)
- return SendClientMessage(playerid, 0xFFFFFFFF, "[ERRO] quantia Invalida");
- pCocaina[playerid] = strval(inputtext);
- SendClientMessage(playerid, 0xFFFFFFFF,"Você Comprou Cocaina");
- GivePlayerMoney(playerid,strval(inputtext)*10);
- return 1;
- }
- if(dialogid == DIALOG_ESCOLHERDROGAS) // Menu
- {
- if(response)
- {
- if(listitem == 0) // maconha
- {
- pMaconha[playerid]--;
- GameTextForPlayer(playerid,"~w~Fumando Maconha~r~.~y~.~g~.", 3000,1);
- ApplyAnimation(playerid,"SMOKING","M_smklean_loop",4.1,1,1,1,1,1);
- SetTimer("FumandoMaconha",5000,false);
- //TogglePlayerControllable(playerid, false);
- }
- if(listitem == 1) // crack
- {
- pCrack[playerid]--;
- GameTextForPlayer(playerid,"~w~Fumando Crack~r~.~y~.~g~.", 3000,1);
- ApplyAnimation(playerid,"SMOKING","M_smklean_loop",4.1,1,1,1,1,1);
- SetTimer("FumandoCrack",5000,false);
- //TogglePlayerControllable(playerid, false);
- }
- if(listitem == 2) // cOCAÍNA
- {
- pCocaina[playerid]--;
- GameTextForPlayer(playerid,"~w~Cheirando Cocaina~r~.~y~.~g~.", 3000,1);
- ApplyAnimation(playerid,"SMOKING","M_smklean_loop",4.1,1,1,1,1,1);
- SetTimer("CheirandoCocaina",5000,false);
- //TogglePlayerControllable(playerid, false);
- }
- }
- return 1;
- }
- }
- public FumandoMaconha(playerid)
- {
- SetPlayerDrunkLevel(playerid,50000);
- SendClientMessage(playerid,0xFFFF00AA,"Você Fumou Maconha, e ficara Tonto por 1 Minuto");
- SetTimer("FicarNormal",60000,false);
- //TogglePlayerControllable(playerid, true);
- }
- public FumandoCrack(playerid)
- {
- SetPlayerDrunkLevel(playerid,50000);
- SendClientMessage(playerid,0xFFFF00AA,"Você Fumou Crack, e ficara Tonto por 1 Minuto");
- SetTimer("FicarNormal",60000,false);
- //TogglePlayerControllable(playerid, true);
- }
- public CheirandoCocaina(playerid)
- {
- SetPlayerDrunkLevel(playerid,50000);
- SendClientMessage(playerid,0xFFFF00AA,"Você Cheirou Cocaína, e ficara Tonto por 1 Minuto");
- SetTimer("FicarNormal",60000,false);
- //TogglePlayerControllable(playerid, true);
- }
- public FicarNormal(playerid)
- {
- SetPlayerDrunkLevel(playerid,0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement