Advertisement
_DarkLight_

Agriculture System Create your garden

Jan 17th, 2016
538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.39 KB | None | 0 0
  1. /*
  2. Create your garden
  3. */
  4. #define lwa9t 1
  5. #define COLOR_RED 0xAA3333AA
  6. #include <a_samp>
  7. #include <zcmd>
  8. public OnFilterScriptInit()
  9. {
  10. print("\n--------------------------------------");
  11. print(" Agriculture System By Dark Light");
  12. print("--------------------------------------\n");
  13. return 1;
  14. }
  15. enum pInfo
  16. {
  17. fla7,
  18. flwe,
  19. }
  20. new PlayerInfo[MAX_PLAYERS][pInfo];
  21. new lbs[MAX_PLAYERS];
  22. new nbta[MAX_OBJECTS];
  23. new ch7al;
  24. new ztmr;
  25. new flbs;
  26. new Float:PX, Float:PY, Float:PZ ,Float:a;
  27. new lvl;
  28. new l7ba;
  29. new error;
  30.  
  31. forward lbss(playerid);
  32. public lbss(playerid)
  33. {
  34. lvl += lwa9t;
  35. error =1;
  36. if(lvl == 5)
  37. {
  38. l7ba =677 ;
  39. DestroyObject(nbta[ch7al]);
  40. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  41. }
  42. if(lvl == 10)
  43. {
  44. l7ba =678 ;
  45. DestroyObject(nbta[ch7al]);
  46. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  47. }
  48. if(lvl == 15)
  49. {
  50. l7ba =679 ;
  51. DestroyObject(nbta[ch7al]);
  52. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  53. }
  54. if(lvl == 20)
  55. {
  56. l7ba =681 ;
  57. DestroyObject(nbta[ch7al]);
  58. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  59. }
  60. if(lvl == 25)
  61. {
  62. l7ba =680 ;
  63. DestroyObject(nbta[ch7al]);
  64. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  65. KillTimer(lbs[playerid]);
  66. lvl = 0;
  67. error =0;
  68. }
  69. return true;
  70. }
  71. forward flw(playerid);
  72. public flw(playerid)
  73. {
  74. lvl += lwa9t;
  75. error =1;
  76. if(lvl == 5)
  77. {
  78. l7ba =677 ;
  79. DestroyObject(nbta[ch7al]);
  80. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  81. }
  82. if(lvl == 10)
  83. {
  84. l7ba =870 ;
  85. DestroyObject(nbta[ch7al]);
  86. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  87. KillTimer(flbs);
  88. lvl = 0;
  89. error =0;
  90. }
  91. return true;
  92. }
  93. CMD:tree(playerid,params[])
  94. {
  95. PlayerInfo[playerid][flwe] = 0;
  96. PlayerInfo[playerid][fla7] = 1;
  97. return 1;
  98. }
  99. CMD:flower(playerid,params[])
  100. {
  101. PlayerInfo[playerid][fla7] = 0;
  102. PlayerInfo[playerid][flwe] = 1;
  103. return 1;
  104. }
  105. public OnFilterScriptExit()
  106. {
  107. return 1;
  108. }
  109. public OnPlayerConnect(playerid)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnPlayerDisconnect(playerid, reason)
  115. {
  116. return 1;
  117. }
  118. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  119. {
  120. if(newkeys & KEY_FIRE)
  121. {
  122. if(error == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your Plant Must Be Big");
  123. if(PlayerInfo[playerid][fla7] ==1)
  124. {
  125. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
  126. KillTimer(lbs[playerid]);
  127. GetPlayerPos(playerid,PX,PY,PZ);
  128. GetPlayerFacingAngle(playerid, a);
  129. ch7al +=1;
  130. l7ba = 675;
  131. KillTimer(lbs[playerid]);
  132. lbs[ztmr] = SetTimerEx("lbss",1000,1,"d",playerid);
  133. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  134. lvl = 0;
  135. }
  136. if(error == 1) return SendClientMessage(playerid,COLOR_RED,"ERROR: Your Plant Must Be Big");
  137. if(PlayerInfo[playerid][flwe] ==1)
  138. {
  139. ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
  140. KillTimer(lbs[playerid]);
  141. GetPlayerPos(playerid,PX,PY,PZ);
  142. GetPlayerFacingAngle(playerid, a);
  143. ch7al +=1;
  144. l7ba = 675;
  145. KillTimer(flbs);
  146. flbs = SetTimerEx("flw",1000,1,"d",playerid);
  147. nbta[ch7al] = CreateObject(l7ba,PX,PY,PZ-0.98, 0.0, 0.0, a);
  148. lvl = 0;
  149. }
  150. }
  151. return 1;
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement