Advertisement
legodude

legodude

Jan 18th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.30 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. #define FILTERSCRIPT
  4. #include <a_samp>
  5. #include <zcmd>
  6. #include <sscanf2>
  7. #define COLOR_DARKORANGE 0xFF3F00AA
  8. new fishes[MAX_PLAYERS];
  9. new fishprogress[MAX_PLAYERS];
  10. forward fishtimer(playerid);
  11. public OnFilterScriptInit()
  12. {
  13. print("\n--------------------------------------");
  14. print(" Blank Filterscript by your name here");
  15. print("--------------------------------------\n");
  16. return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21. return 1;
  22. }
  23.  
  24. public OnGameModeInit()
  25. {
  26. // Don't use these lines if it's a filterscript
  27. SetGameModeText("Blank Script");
  28. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  29. AddStaticVehicleEx(453,2937.2935,-2062.6792,-0.1762,180.7421,56,56,15000); // boatwerk1
  30. AddStaticVehicleEx(453,2930.7781,-2063.4063,-0.2910,179.4181,56,56,15000); // boatwerk2
  31. AddStaticVehicleEx(453,2930.5361,-2043.3026,-0.5164,358.8169,56,56,15000); // boatwerk3
  32. AddStaticVehicleEx(453,2936.2163,-2043.3353,-0.5593,358.6886,56,56,15000); // boatwerk4
  33. return 1;
  34. }
  35.  
  36. public OnGameModeExit()
  37. {
  38. return 1;
  39. }
  40.  
  41. public OnPlayerRequestClass(playerid, classid)
  42. {
  43. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  44. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  45. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  46. return 1;
  47. }
  48.  
  49.  
  50.  
  51.  
  52. COMMAND:gotofish(playerid,params[])
  53. {
  54. SetPlayerPos(playerid,2941.1365,-2051.7290,3.5480);
  55. return 1;
  56. }
  57.  
  58. COMMAND:fish(playerid,params[])
  59. {
  60. if(!IsPlayerInRangeOfPoint(playerid, 7.0, 2941.1365,-2051.7290,3.5480)) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're not at the fishing place");
  61. if(fishprogress[playerid] > 0) return SendClientMessage(playerid,COLOR_DARKORANGE,"You're already doing this job!");
  62. else
  63. fishprogress[playerid] = 1;
  64. SendClientMessage(playerid,COLOR_DARKORANGE,"You've started your fishing job. Take a boat and go to the checkpoints!");
  65. SetPlayerCheckpoint(playerid,3019.4819,-1259.1970,0.8884,4.0);
  66. return 1;
  67. }
  68.  
  69. COMMAND:fishes(playerid,params[])
  70. {
  71. new string[100];
  72. format(string,sizeof(string),"You have %d fishes",fishes[playerid]);
  73. SendClientMessage(playerid,COLOR_DARKORANGE,string);
  74. return 1;
  75. }
  76.  
  77. stock IsPlayerInRangeOfFishCP(playerid)
  78. {
  79. if(IsPlayerInRangeOfPoint(playerid,4.0,3215.4434,-1035.6681,0.7980)||IsPlayerInRangeOfPoint(playerid,4.0,3019.4819,-1259.1970,0.8884)||IsPlayerInRangeOfPoint(playerid,4.0,3115.2380,-511.2403,0.9685))
  80. {
  81. return 1;
  82. }
  83. else if(IsPlayerInRangeOfPoint(playerid,4.0,2979.5803,-8.0016,1.4147)||IsPlayerInRangeOfPoint(playerid,4.0,2488.8032,472.4902,0.8335)||IsPlayerInRangeOfPoint(playerid,4.0,2358.1958,518.7128,-0.3048))
  84. {
  85. return 1;
  86. }
  87. return 0;
  88. }
  89.  
  90. public OnPlayerEnterCheckpoint(playerid)
  91. {
  92. if(IsPlayerInRangeOfFishCP(playerid))
  93. {
  94. if(fishprogress[playerid] == 1)
  95. {
  96. SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
  97. SetTimerEx("fishtimer",5000,false,"i",playerid);
  98. fishes[playerid] += 1;
  99. TogglePlayerControllable(playerid,0);
  100. SetPlayerCheckpoint(playerid,3215.4434,-1035.6681,0.7980,4.0);
  101. fishprogress[playerid] = 2;
  102. }
  103. else
  104. if(fishprogress[playerid] == 2)
  105. {
  106. SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
  107. SetTimerEx("fishtimer",5000,false,"i",playerid);
  108. fishes[playerid] += 1;
  109. TogglePlayerControllable(playerid,0);
  110. SetPlayerCheckpoint(playerid,3019.4819,-1259.1970,0.8884,4.0);
  111. fishprogress[playerid] = 3;
  112. }
  113. else
  114. if(fishprogress[playerid] == 3)
  115. {
  116. SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
  117. SetTimerEx("fishtimer",5000,false,"i",playerid);
  118. fishes[playerid] += 1;
  119. TogglePlayerControllable(playerid,0);
  120. SetPlayerCheckpoint(playerid,3115.2380,-511.2403,0.9685,4.0);
  121. fishprogress[playerid] = 4;
  122. }
  123. else
  124. if(fishprogress[playerid] == 4)
  125. {
  126. SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
  127. SetTimerEx("fishtimer",5000,false,"i",playerid);
  128. fishes[playerid] += 1;
  129. TogglePlayerControllable(playerid,0);
  130. SetPlayerCheckpoint(playerid,2979.5803,-8.0016,1.4147,4.0);
  131. fishprogress[playerid] = 5;
  132. }
  133. else
  134. if(fishprogress[playerid] == 5)
  135. {
  136. SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
  137. SetTimerEx("fishtimer",5000,false,"i",playerid);
  138. fishes[playerid] += 1;
  139. TogglePlayerControllable(playerid,0);
  140. SetPlayerCheckpoint(playerid,2488.8032,472.4902,0.8335,4.0);
  141. fishprogress[playerid] = 6;
  142. }
  143. else
  144. if(fishprogress[playerid] == 6)
  145. {
  146. SendClientMessage(playerid,COLOR_DARKORANGE,"**Reeling in Fishes**");
  147. SetTimerEx("fishtimer",5000,false,"i",playerid);
  148. fishes[playerid] += 1;
  149. TogglePlayerControllable(playerid,0);
  150. SetPlayerCheckpoint(playerid,2358.1958,518.7128,-0.3048,4.0);
  151. fishprogress[playerid] = 7;
  152. }
  153. else
  154. if(fishprogress[playerid] == 7)
  155. {
  156. SendClientMessage(playerid,COLOR_DARKORANGE,"Taking your fishes out of the boat");
  157. SetTimerEx("fishtimer",15000,false,"i",playerid);
  158. fishes[playerid] += 1;
  159. TogglePlayerControllable(playerid,0);
  160. DisablePlayerCheckpoint(playerid);
  161. fishprogress[playerid] = 8;
  162. }
  163. }
  164. return 1;
  165. }
  166.  
  167.  
  168. public fishtimer(playerid)
  169. {
  170. if(IsPlayerConnected(playerid))
  171. {
  172. TogglePlayerControllable(playerid,1);
  173. if(fishprogress[playerid] == 8)
  174. {
  175. SendClientMessage(playerid,COLOR_DARKORANGE,"You've unloaded your fishes from the boat.");
  176. SendClientMessage(playerid,COLOR_DARKORANGE,"____________________");
  177. SendClientMessage(playerid,COLOR_DARKORANGE,"Earning:$2000");
  178. SendClientMessage(playerid,COLOR_DARKORANGE,"____________________");
  179. GivePlayerMoney(playerid,2000);
  180. TogglePlayerControllable(playerid,1);//this one's unneeded because you are unfreezing 'em already at line 172
  181. fishprogress[playerid] = 0;
  182. }
  183.  
  184. }
  185. return 1;
  186. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement