Guest User

Untitled

a guest
Sep 1st, 2010
1,385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.85 KB | None | 0 0
  1. // This little script was scripted by KotoK.
  2.  
  3. #include <a_samp>
  4. #include <core>
  5. #include <float>
  6. #define FILTERSCRIPT
  7.  
  8. #define GREENCOLOR 0x33AA33AA
  9. #define WHITECOLOR 0xFFFFFFAA
  10. #define GREYCOLOR 0xD8D8D8FF
  11. #define YELLOWCOLOR 0xDABB3EAA
  12.  
  13. forward finished(playerid);
  14.  
  15. new cmd[256];
  16. new smoking[MAX_PLAYERS];
  17. new cigarette[MAX_PLAYERS];
  18. new lighter[MAX_PLAYERS];
  19.  
  20. public OnFilterScriptInit()
  21. {
  22. return 1;
  23. }
  24.  
  25. public OnFilterScriptExit()
  26. {
  27. return 1;
  28. }
  29.  
  30. public OnPlayerConnect(playerid)
  31. {
  32. smoking[playerid] = 0;
  33. cigarette[playerid] = 0;
  34. lighter[playerid] = 0;
  35. return 1;
  36. }
  37.  
  38. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  39. {
  40. if(response)
  41. {
  42. if(dialogid == 0)
  43. {
  44. SendClientMessage(playerid, GREYCOLOR, "You buyed cigarete! For more help, use cmd /cmds!");
  45. cigarette[playerid] += 1;
  46. return 1;
  47. }
  48. if(dialogid == 1)
  49. {
  50. SendClientMessage(playerid, GREYCOLOR, "You buyed lighter for! For more help, use cmd /cmds!");
  51. lighter[playerid] += 1;
  52. return 1;
  53. }
  54. }
  55. return 1;
  56. }
  57.  
  58. public OnPlayerCommandText(playerid, cmdtext[])
  59. {
  60. if(strcmp(cmd, "/cmds", true) == 0)
  61. {
  62. SendClientMessage(playerid, GREENCOLOR, "Smoking commands");
  63. SendClientMessage(playerid, WHITECOLOR, "/smoke, /buy, /drop.");
  64. return 1;
  65. }
  66. if(strcmp(cmd, "/buy", true) == 0)
  67. {
  68. ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"Buyable Stuff","Cigarette\nLighter","Buy","Cancel");
  69. }
  70. if(strcmp(cmd, "/drop", true) == 0)
  71. {
  72. SendClientMessage(playerid, WHITECOLOR, "Your cigarette and lighter was successfully throwed away!");
  73. lighter[playerid] = 0;
  74. cigarette[playerid] = 0;
  75. return 1;
  76. }
  77. if(strcmp(cmd, "/smoke", true) == 0)
  78. {
  79. if(smoking[playerid] == 1)
  80. {
  81. SendClientMessage(playerid, GREYCOLOR, "The possibility of a smoking several cigarettes while being closed!");
  82. return 1;
  83. }
  84. if(cigarette[playerid] == 0)
  85. {
  86. SendClientMessage(playerid, GREYCOLOR, "To smoke cigarette, you must have purchased cigarette!");
  87. return 1;
  88. }
  89. if(lighter[playerid] == 0)
  90. {
  91. SendClientMessage(playerid, GREYCOLOR, "To smoke cigarette, you must have purchased lighter!");
  92. return 1;
  93. }
  94. if(smoking[playerid] == 1)
  95. {
  96. SendClientMessage(playerid, YELLOWCOLOR, "Cigarette was succesfully lighted up and after a 2 minutes interval, it will automatically dissapear.");
  97. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
  98. SetTimerEx("finished", 200000, 0, "i", playerid);
  99. cigarette[playerid] -= 1;
  100. lighter[playerid] -= 1;
  101. return 1;
  102. }
  103. }
  104. return 1;
  105. }
  106.  
  107. public finished(playerid)
  108. {
  109. SendClientMessage(playerid, YELLOWCOLOR, "You finished your cigarette and throwed it away!");
  110. ClearAnimations(playerid);
  111. return 1;
  112. }
Advertisement
Add Comment
Please, Sign In to add comment