Advertisement
Guest User

Rens

a guest
Mar 16th, 2010
1,732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.35 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define COLOR_DARKGOLD 0x808000AA
  4. #define COLOR_RED 0xFF0000AA
  5. #define COLOR_YELLOW 0xFFFF00AA
  6. #define Checkpoint1 -256.0010,-1542.3809,3.9930
  7. #define Checkpoint2 -231.8289,-1467.9810,4.9421
  8. #define Checkpoint3 -193.9747,-1375.2502,4.7856
  9. #define Checkpoint4 -246.0348,-1326.1063,8.9300
  10. #define Checkpoint5 -407.1459,-1371.5518,23.6588
  11. #define Checkpoint6 -564.7697,-1302.4977,22.5511
  12. #define Checkpoint7 -569.0633,-1508.3352,9.1518
  13.  
  14.  
  15.  
  16. new combinejobrunning = 0;
  17. new info;
  18.  
  19. forward GivePlayerOneExp(playerid);
  20.  
  21. public OnFilterScriptInit()
  22. {
  23. AddStaticVehicleEx(532,-370.1018,-1463.1403,26.6953,287.0754,0,0,10); // combine 1
  24. AddStaticVehicleEx(532,-364.2571,-1479.7140,26.7041,285.6486,0,0,10); // combine 2
  25. AddStaticVehicleEx(532,-361.6030,-1501.2618,24.8698,285.8201,0,0,10); // combine 3
  26.  
  27. info = CreatePickup(1239,1,-366.1941,-1440.3253,25.7266,-1);
  28. }
  29.  
  30. public OnPlayerCommandText(playerid, cmdtext[])
  31. {
  32. if (strcmp("/combine", cmdtext, true, 10) == 0)
  33. {
  34. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 532)
  35. {
  36. SetPlayerCheckpoint(playerid, Checkpoint1, 3.0);
  37. CreateObject(823,-256.0010,-1542.3809,3.9930,0,0,0);
  38. combinejobrunning = 1;
  39. GameTextForPlayer(playerid, "~g~You started the job, good luck!", 3000, 3);
  40. new name[MAX_PLAYER_NAME], string[48];
  41. GetPlayerName(playerid, name, sizeof(name));
  42. format(string, sizeof(string), "%s is now doing the Combine job.", name );
  43. SendClientMessageToAll(COLOR_RED, string);
  44. return 1;
  45. }
  46. SendClientMessage(playerid, COLOR_RED,"You have to be in a truck to start the job");
  47. }
  48.  
  49. if (strcmp("/combineinfo", cmdtext, true, 10) == 0)
  50. {
  51. SendClientMessage(playerid, COLOR_YELLOW, "You need the harvest the weed.");
  52. SendClientMessage(playerid, COLOR_YELLOW, "If you enter the combine, type /combine and a red marker will appear.");
  53. SendClientMessage(playerid, COLOR_YELLOW, "Just drive to the markers and you're done.");
  54. return 1;
  55. }
  56. return 0;
  57. }
  58. public OnPlayerEnterCheckpoint(playerid)
  59. {
  60. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 532)
  61. {
  62. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint1))
  63. {
  64. SetPlayerCheckpoint(playerid, Checkpoint2, 7.0);
  65. CreateObject(823,-231.8289,-1467.9810,4.9421,0,0,0);
  66. }
  67. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint2))
  68. {
  69. SetPlayerCheckpoint(playerid, Checkpoint3, 7.0);
  70. CreateObject(823,-193.9747,-1375.2502,4.7856,0,0,0);
  71. }
  72. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint3))
  73. {
  74. SetPlayerCheckpoint(playerid, Checkpoint4, 7.0);
  75. CreateObject(823,-246.0348,-1326.1063,8.9300,0,0,0);
  76. }
  77. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint4))
  78. {
  79. SetPlayerCheckpoint(playerid, Checkpoint5, 7.0);
  80. CreateObject(823,-407.1459,-1371.5518,23.6588,0,0,0);
  81. }
  82. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint5))
  83. {
  84. SetPlayerCheckpoint(playerid, Checkpoint6, 7.0);
  85. CreateObject(823,-564.7697,-1302.4977,22.5511,0,0,0);
  86. }
  87. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint6))
  88. {
  89. SetPlayerCheckpoint(playerid, Checkpoint7, 7.0);
  90. }
  91. if (IsPlayerInRangeOfPoint(playerid, 7.0,Checkpoint7))
  92. {
  93. GivePlayerMoney(playerid, 10000);
  94. GameTextForPlayer(playerid, "~g~You Completed the job, well done!", 3000, 3);
  95. SetVehicleToRespawn(2);
  96. combinejobrunning = 0;
  97. DisablePlayerCheckpoint(playerid);
  98. }
  99. }
  100. }
  101.  
  102. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  103. {
  104. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 532)
  105. {
  106. SendClientMessage(playerid, COLOR_RED, "You can start the combine-job with /combine");
  107. }
  108. return 0;
  109. }
  110. public OnPlayerExitVehicle(playerid, vehicleid)
  111. {
  112. if((combinejobrunning) == 1)
  113. {
  114. combinejobrunning = 0;
  115. SendClientMessage(playerid, COLOR_RED, "You left your combine behind, get in again if you want to continue your job.");
  116.  
  117. }else if((combinejobrunning) == 0){
  118.  
  119. //Nothing
  120. }
  121. }
  122.  
  123. public OnPlayerPickUpPickup(playerid, pickupid)
  124. {
  125. if(pickupid == info)
  126. {
  127. GameTextForPlayer(playerid, "~g~Welcome at the Combine job, use /combineinfo to know more", 3000, 3);
  128. }
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement