Advertisement
Guest User

SAMP Trucking Job Script by Angelo

a guest
Aug 28th, 2017
2,272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.20 KB | None | 0 0
  1. // ~ ~ Trucking Job SAMP Script ~ ~ //
  2. // Made by "Angelo Ianson Brand" //
  3. // ~Please dont Remove my Credit~ //
  4.  
  5.  
  6. /* Include */
  7. #include <a_samp>
  8. #include <zcmd>
  9.  
  10. /* Colour */
  11. #define COLOR_RED 0xFF0000FF
  12. #define COLOR_SILVER 0xDDDDDDFF
  13. #define COLOR_GREEN 0x00FF00FF
  14. #define COLOR_YELLOW 0xFFFF00FF
  15. #define COLOR_ORANGE 0xFF9900FF
  16.  
  17. new Trucker[256];
  18. new Trucking[256];
  19.  
  20. public OnGameModeInit()
  21. {
  22. Trucking[0] = CreateVehicle(456,-44.6190,-1155.5164,1.2519,64.7519,-1,-1,5); //Trucking Car 1
  23. Trucking[1] = CreateVehicle(456,-42.9047,-1151.9404,1.2517,64.0807,-1,-1,5); //Trucking Car 2
  24. Trucking[2] = CreateVehicle(456,-41.1424,-1148.3170,1.2518,63.6309,-1,-1,5); //Trucking Car 3
  25. Trucking[3] = CreateVehicle(456,-39.3955,-1144.7775,1.2519,62.9386,-1,-1,5); //Trucking Car 4
  26. Trucking[4] = CreateVehicle(456,-37.5739,-1141.0938,1.2513,62.9641,-1,-1,5); //Trucking Car 5
  27. return 1;
  28. }
  29.  
  30. public OnPlayerStateChange(playerid, newstate, oldstate)
  31. {
  32. if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER)
  33. {
  34. if(GetPlayerVehicleID(playerid) == Trucking[0])
  35. {
  36.  
  37. Trucker[playerid] = 1;
  38. new name[MAX_PLAYER_NAME], string[48];
  39. GetPlayerName(playerid, name, sizeof(name));
  40. format(string, sizeof(string), "~ %s is now an on duty as Trucker.", name );
  41. SendClientMessageToAll(COLOR_SILVER, string);
  42. GameTextForPlayer(playerid,"~g~Mission Started!",5000,5);
  43. SetPlayerRaceCheckpoint(playerid, 1, 274.4175, 1408.9670, 10.1056, 0, 0, 0, 5.0);
  44. SendClientMessage(playerid, COLOR_ORANGE, "Trucking missions enabled, go to the marker to get the shipment.");
  45. }
  46. if(GetPlayerVehicleID(playerid) == Trucking[1])
  47. {
  48. Trucker[playerid] = 1;
  49. new name[MAX_PLAYER_NAME], string[48];
  50. GetPlayerName(playerid, name, sizeof(name));
  51. format(string, sizeof(string), "~ %s is now an on duty as Trucker.", name );
  52. SendClientMessageToAll(COLOR_SILVER, string);
  53. GameTextForPlayer(playerid,"~g~Mission Started!",5000,5);
  54. SetPlayerRaceCheckpoint(playerid, 1, 274.4175, 1408.9670, 10.1056, 0, 0, 0, 5.0);
  55. SendClientMessage(playerid, COLOR_ORANGE, "Trucking missions enabled, go to the marker to get the shipment.");
  56. }
  57. if(GetPlayerVehicleID(playerid) == Trucking[2])
  58. {
  59. Trucker[playerid] = 1;
  60. new name[MAX_PLAYER_NAME], string[48];
  61. GetPlayerName(playerid, name, sizeof(name));
  62. format(string, sizeof(string), "~ %s is now an on duty as Trucker.", name );
  63. SendClientMessageToAll(COLOR_SILVER, string);
  64. GameTextForPlayer(playerid,"~g~Mission Started!",5000,5);
  65. SetPlayerRaceCheckpoint(playerid, 1, 274.4175, 1408.9670, 10.1056, 0, 0, 0, 5.0);
  66. SendClientMessage(playerid, COLOR_ORANGE, "Trucking missions enabled, go to the marker to get the shipment.");
  67. }
  68. if(GetPlayerVehicleID(playerid) == Trucking[3])
  69. {
  70. Trucker[playerid] = 1;
  71. new name[MAX_PLAYER_NAME], string[48];
  72. GetPlayerName(playerid, name, sizeof(name));
  73. format(string, sizeof(string), "~ %s is now an on duty as Trucker.", name );
  74. SendClientMessageToAll(COLOR_SILVER, string);
  75. GameTextForPlayer(playerid,"~g~Mission Started!",5000,5);
  76. SetPlayerRaceCheckpoint(playerid, 1, 274.4175, 1408.9670, 10.1056, 0, 0, 0, 5.0);
  77. SendClientMessage(playerid, COLOR_ORANGE, "Trucking missions enabled, go to the marker to get the shipment.");
  78. }
  79. if(GetPlayerVehicleID(playerid) == Trucking[4])
  80. {
  81. Trucker[playerid] = 1;
  82. new name[MAX_PLAYER_NAME], string[48];
  83. GetPlayerName(playerid, name, sizeof(name));
  84. format(string, sizeof(string), "~ %s is now an on duty as Trucker.", name );
  85. SendClientMessageToAll(COLOR_SILVER, string);
  86. GameTextForPlayer(playerid,"~g~Mission Started!",5000,5);
  87. SetPlayerRaceCheckpoint(playerid, 1, 274.4175, 1408.9670, 10.1056, 0, 0, 0, 5.0);
  88. SendClientMessage(playerid, COLOR_ORANGE, "Trucking missions enabled, go to the marker to get the shipment.");
  89. }
  90. }
  91. if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
  92. {
  93. if(Trucker[playerid] > 0 )
  94. {
  95. Trucker[playerid] = 0;
  96. new name[MAX_PLAYER_NAME], string[48];
  97. GetPlayerName(playerid, name, sizeof(name));
  98. format(string, sizeof(string), "~ %s has left his job as Trucker.", name );
  99. SendClientMessageToAll(COLOR_RED, string);
  100. DisablePlayerRaceCheckpoint(playerid);
  101. PlayerPlaySound(playerid, 1139, 0.0, 0.0, 10.0);
  102. GameTextForPlayer(playerid,"~r~Mission Canceled!",5000,5);
  103. SendClientMessage(playerid, 0xFF0000FF, "You have canceled the mission - Dont left the vehicles!");
  104. }
  105. }
  106. return 1;
  107. }
  108.  
  109. public OnPlayerEnterRaceCheckpoint(playerid)
  110. {
  111. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == Trucking[0],Trucking[1],Trucking[2],Trucking[3],Trucking[4])
  112. {
  113. if(Trucker[playerid] == 1){
  114. Trucker[playerid] = 2;
  115. SendClientMessage(playerid, COLOR_YELLOW, "You have got the shipment, now make your way to the dealer.");
  116. SetPlayerRaceCheckpoint(playerid, 1, -1643.4783, -2686.9014, 48.2021, 0, 0, 0, 5.0);
  117. return 1;
  118. }
  119. if(Trucker[playerid] == 2){
  120. Trucker[playerid] = 0;
  121. TogglePlayerControllable(playerid, 0);
  122. DisablePlayerRaceCheckpoint(playerid);
  123. TogglePlayerControllable(playerid, 1);
  124. GameTextForPlayer(playerid,"~g~Mission Completed!",5000,5);
  125. SendClientMessage(playerid, 0xFF00FF, "Congratulations! You have earned $10000 from finished the Trucking Missions.");
  126. PlayerPlaySound(playerid, 1139, 0.0, 0.0, 10.0);
  127. GivePlayerMoney(playerid,10000);
  128. new name[MAX_PLAYER_NAME], string[48];
  129. GetPlayerName(playerid, name, sizeof(name));
  130. format(string, sizeof(string), "~ %s has completed the trucking missions.", name );
  131. SendClientMessageToAll(COLOR_GREEN, string);
  132. RemovePlayerFromVehicle(playerid);
  133. SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  134. }
  135. }
  136. return 1;
  137. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement