Advertisement
Private200

Checking trailer

May 23rd, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.05 KB | None | 0 0
  1. //-- Defining the player teams --//
  2.  
  3. #define TEAM_TRUCKER 1
  4.  
  5. //-- Making the mission things for trucker --//
  6.  
  7. enum MisLocationsEnum
  8. {
  9. ID,
  10. LoadName[128],
  11. Float:LoadX,
  12. Float:LoadY,
  13. Float:LoadZ,
  14. Float:UnloadX,
  15. Float:UnloadY,
  16. Float:UnloadZ,
  17. Pay,
  18. TrailerID
  19. }
  20.  
  21.  
  22. //-- Defining the player work --//
  23.  
  24. new work;
  25.  
  26. //-- Defines for the truckers job or missions --//
  27.  
  28. new MisLocations[][MisLocationsEnum] =
  29. {
  30. {0, "Beer from Red County Brewery to Bone County Diner",-24.4073,-281.8898,5.9985,-305.4319,1315.6797,54.6189, 5980, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 435)*/},
  31. {1, "Fuel from LV Oil Refinery to LV Dirtring",266.8981,1416.5417,10.2001,1097.5164,1741.7422,10.5474, 5700, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)*/},
  32. {2, "Vehicle Parts from SF Airport ATC to Wang Cars",-1268.8223,13.6925,14.8682,-1986.3477,253.9728,35.8985, 3000, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 435)*/},
  33. {3, "Fuel from SF Oil Refinery to RS Haul",-1016.3634,-688.2434,32.7284,-55.3397,-1138.2479,0.8052, 18770, /*(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == 584)*/},
  34. {4, "Trucking Job, Deliver the Goods",-1690.3000, -93.8587, 5.9922,-1878.6992, -1726.9730, 23.3750, 20770},
  35. {5, "Trucking Job, Deliver the Goods",-373.1002, -1053.5399, 57.8594,2349.0000, -1411.6610, 26.2266, 20770},
  36. {6, "Trucking Job, Deliver the Goods",2774.1663, -2401.0645, 14.1719,868.6686, -1233.7817, 17.6406, 20770},
  37. {7, "Trucking Job, Deliver the Goods",-1522.2748, -631.8068, 25.3359,-2326.2029, -172.0190, 34.6719, 20770},
  38. {8, "Trucking Job, Deliver the Goods",-2532.1748, -613.5323, 132.4539,-3384.3538, 224.6254, 24.2500, 20770},
  39. {9, "Trucking Job, Deliver the Goods",-3399.4221, 668.3398, 16.4000,-1491.2068, 2564.9553, 54.7266, 20770}
  40. };
  41.  
  42. //-- Defines for trucker job to work --//
  43.  
  44. new Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], iPay[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];
  45.  
  46. COMMAND:work(playerid, params[])
  47. {
  48. if (work == 0)
  49. {
  50. if(GetPlayerTeam(playerid) == TEAM_TRUCKER)
  51. {
  52. T_NewJob(playerid);
  53. }
  54. }
  55. else if (work == 1)
  56. {
  57. SendClientMessage(playerid,-1,"You're already managing an task. /stopwork to leave it.");
  58. }
  59. return 1;
  60. }
  61.  
  62. CMD:stopwork(playerid, params[])
  63. {
  64. #pragma unused params
  65. if(GetPlayerTeam(playerid) == TEAM_TRUCKER) return StopClassWork(playerid);
  66. return 1;
  67. }
  68.  
  69. //-- Stock to stop the player work --//
  70. stock StopClassWork(playerid)
  71. {
  72. DisablePlayerCheckpoint(playerid);
  73. SendClientMessage(playerid, COLOR_RED, "Your company was not happy from your work and gave you 1500$ fine.");
  74. work = 0;
  75. GivePlayerMoney(playerid, -1500);
  76. MissionStatus[playerid] = 0;
  77. return 1;
  78. }
  79.  
  80. //-- Creating the stock for the trucker job. --//
  81.  
  82. stock T_NewJob(playerid)
  83. {
  84. new vID = GetPlayerVehicleID(playerid);
  85. if(GetVehicleModel(vID)== 403 || GetVehicleModel(vID)== 515 || GetVehicleModel(vID) == 514)
  86. {
  87. if(IsTrailerAttachedToVehicle(vID))
  88. {
  89. MissionStatus[playerid] = 1;
  90. new MisRand = random(sizeof(MisLocations));
  91. new LoadText[128], Float:x, Float:y, Float:z;
  92. x = MisLocations[MisRand][LoadX];
  93. y = MisLocations[MisRand][LoadY];
  94. z = MisLocations[MisRand][LoadZ];
  95. unx[playerid] = MisLocations[MisRand][UnloadX];
  96. uny[playerid] = MisLocations[MisRand][UnloadY];
  97. unz[playerid] = MisLocations[MisRand][UnloadZ];
  98. iPay[playerid] = MisLocations[MisRand][Pay];
  99. SetPlayerCheckpoint(playerid, x, y, z, 7);
  100. // TextDrawShowForPlayer(playerid, Textdraw1);
  101. format(LoadText, 128, "%s",MisLocations[MisRand][LoadName]);
  102. work = 1;
  103. SendClientMessage(playerid, COLOR_GREEN, "Mission:");
  104. SendClientMessage(playerid, 0xFFFFFFFF, LoadText);
  105. // TextDrawHideForPlayer(playerid, msg1[playerid]);
  106. }
  107. else
  108. {
  109. SendClientMessage(playerid, COLOR_RED, "You need a trailer!");
  110. }
  111. }
  112. else
  113. {
  114. SendClientMessage(playerid, COLOR_RED, "You must be in a Truck to perform this!");
  115. }
  116. return 1;
  117. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement