Advertisement
Guest User

Untitled

a guest
Nov 21st, 2011
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define WeedEffect 550
  4. #define NoEffect 0
  5.  
  6. new SmokeClick[MAX_PLAYERS];
  7. new Smoking[MAX_PLAYERS];
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print("pot smoking by marshall_mathers a.k.a. JTWEAK");
  13. print("pot smoking by marshall_mathers a.k.a. JTWEAK");
  14. print("--------------------------------------\n");
  15. return 1;
  16. }
  17.  
  18. public OnFilterScriptExit()
  19. {
  20. return 1;
  21. }
  22.  
  23. public OnPlayerCommandText(playerid, cmdtext[])
  24. {
  25. if (strcmp("/weedcigar", cmdtext, true, 10) == 0)
  26. {
  27. SetPlayerSpecialAction(playerid,21);
  28. return 1;
  29. }
  30. return 0;
  31. }
  32.  
  33. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  34. {
  35. if(newkeys == KEY_FIRE)
  36. {
  37. if(GetPlayerSpecialAction(playerid) == 21)
  38. {
  39. if(Smoking[playerid] == 0)
  40. {
  41. if(SmokeClick[playerid] <= 12)
  42. {
  43. SmokeClick[playerid] += 1;
  44. Smoking[playerid] = 1;
  45. SetTimerEx("Nosmoking", 3400, false, "i", playerid);
  46. SendClientMessage(playerid,0x33AA33AA, "you took a hit off tha blunt.");
  47. //SetPlayerDrunkLevel(playerid, GetPlayerDrunkLevel(playerid) + WeedEffect);
  48. }
  49. }
  50. }
  51. }
  52. return 1;
  53. }
  54. public OnPlayerUpdate(playerid)
  55. {
  56. if(SmokeClick[playerid] == 12)
  57. {
  58. SetTimerEx("Stoned", 3500, false, "i", playerid);
  59. SetPlayerSpecialAction(playerid,0);
  60. }
  61. return 1;
  62. }
  63.  
  64. forward Nosmoking(playerid);
  65. public Nosmoking(playerid)
  66. {
  67. Smoking[playerid] = 0;
  68. return 1;
  69. }
  70.  
  71. forward EffectDone(playerid);
  72. public EffectDone(playerid)
  73. {
  74. SetPlayerWeather(playerid, 10);
  75. SmokeClick[playerid] = 0;
  76. SetPlayerDrunkLevel(playerid, NoEffect);
  77. return 1;
  78. }
  79.  
  80. forward Stoned(playerid);
  81. public Stoned(playerid)
  82. {
  83. SetPlayerWeather(playerid, -68);
  84. GameTextForPlayer(playerid, "~w~You are ~p~Stoned", 10000, 1);
  85. SetTimerEx("EffectDone", 15000, false, "i", playerid);
  86. return 1;
  87. }
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement