Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This little script was scripted by KotoK.
- #include <a_samp>
- #include <core>
- #include <float>
- #define FILTERSCRIPT
- #define GREENCOLOR 0x33AA33AA
- #define WHITECOLOR 0xFFFFFFAA
- #define GREYCOLOR 0xD8D8D8FF
- #define YELLOWCOLOR 0xDABB3EAA
- forward finished(playerid);
- new cmd[256];
- new smoking[MAX_PLAYERS];
- new cigarette[MAX_PLAYERS];
- new lighter[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- smoking[playerid] = 0;
- cigarette[playerid] = 0;
- lighter[playerid] = 0;
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(response)
- {
- if(dialogid == 0)
- {
- SendClientMessage(playerid, GREYCOLOR, "You buyed cigarete! For more help, use cmd /cmds!");
- cigarette[playerid] += 1;
- return 1;
- }
- if(dialogid == 1)
- {
- SendClientMessage(playerid, GREYCOLOR, "You buyed lighter for! For more help, use cmd /cmds!");
- lighter[playerid] += 1;
- return 1;
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmd, "/cmds", true) == 0)
- {
- SendClientMessage(playerid, GREENCOLOR, "Smoking commands");
- SendClientMessage(playerid, WHITECOLOR, "/smoke, /buy, /drop.");
- return 1;
- }
- if(strcmp(cmd, "/buy", true) == 0)
- {
- ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Buyable Stuff","Cigarette\nLighter","Buy","Cancel");
- }
- if(strcmp(cmd, "/drop", true) == 0)
- {
- SendClientMessage(playerid, WHITECOLOR, "Your cigarette and lighter was successfully throwed away!");
- lighter[playerid] = 0;
- cigarette[playerid] = 0;
- return 1;
- }
- if(strcmp(cmd, "/smoke", true) == 0)
- {
- if(smoking[playerid] == 1)
- {
- SendClientMessage(playerid, GREYCOLOR, "The possibility of a smoking several cigarettes while being closed!");
- return 1;
- }
- if(cigarette[playerid] == 0)
- {
- SendClientMessage(playerid, GREYCOLOR, "To smoke cigarette, you must have purchased cigarette!");
- return 1;
- }
- if(lighter[playerid] == 0)
- {
- SendClientMessage(playerid, GREYCOLOR, "To smoke cigarette, you must have purchased lighter!");
- return 1;
- }
- if(smoking[playerid] == 1)
- {
- SendClientMessage(playerid, YELLOWCOLOR, "Cigarette was succesfully lighted up and after a 2 minutes interval, it will automatically dissapear.");
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
- SetTimerEx("finished", 200000, 0, "i", playerid);
- cigarette[playerid] -= 1;
- lighter[playerid] -= 1;
- return 1;
- }
- }
- return 1;
- }
- public finished(playerid)
- {
- SendClientMessage(playerid, YELLOWCOLOR, "You finished your cigarette and throwed it away!");
- ClearAnimations(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment