Guest User

Untitled

a guest
Apr 1st, 2014
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. //--News--//
  2. new MissionText[512][MAX_PLAYERS], Float:unx[MAX_PLAYERS], Float:uny[MAX_PLAYERS], Float:unz[MAX_PLAYERS], HashtagID[MAX_PLAYERS], Payment[MAX_PLAYERS], MissionStatus[MAX_PLAYERS];
  3.  
  4. new PlayerMissionID[MAX_PLAYERS];
  5.  
  6. //--Trucker Mission Enum--//
  7. enum TruckerLocationsEnum
  8. {
  9. MissionID,
  10. TrailerID,
  11. LoadName[128],
  12. Float:LoadX,
  13. Float:LoadY,
  14. Float:LoadZ,
  15. Float:UnloadX,
  16. Float:UnloadY,
  17. Float:UnloadZ,
  18. HashID,
  19. Pay
  20. }
  21.  
  22. //--Trucker Locations--//
  23. new TruckerLocations[][TruckerLocationsEnum] =
  24. {
  25. {0, 535, "This is wrong", -24.4073, -281.8898, 5.9985, -305.4319, 1315.6797, 54.6189, 0, 10780},
  26. {1, 584, "This is correct", 266.8981, 1416.5417, 10.2001, 1097.5164, 1741.7422, 10.5474, 1, 6700},
  27. {2, 535, "This is wrong", -1268.8223, 13.6925, 14.8682, -1986.3477, 253.9728, 35.8985, 2, 4780},
  28. {3, 535, "This is wrong", -1016.3634, -688.2434, 32.7284, -55.3397, -1138.2479, 0.8052, 3, 18770}
  29. };
  30.  
  31. stock TruckerTask(playerid)
  32. {
  33. new VehID = GetPlayerVehicleID(playerid);
  34. if(GetVehicleModel(VehID)== 403 || GetVehicleModel(VehID)== 515 || GetVehicleModel(VehID) == 514)
  35. {
  36. if(IsTrailerAttachedToVehicle(VehID))
  37. {
  38. if(GetVehicleModel(GetVehicleTrailer(GetPlayerVehicleID(playerid))) == TruckerLocations[PlayerMissionID[playerid]][TrailerID])
  39. {
  40. MissionStatus[playerid] = 1;
  41. new MisRand = random(sizeof(TruckerLocations));
  42. new LoadText[128], Float:x, Float:y, Float:z;
  43. x = TruckerLocations[MisRand][LoadX];
  44. y = TruckerLocations[MisRand][LoadY];
  45. z = TruckerLocations[MisRand][LoadZ];
  46. unx[playerid] = TruckerLocations[MisRand][UnloadX];
  47. uny[playerid] = TruckerLocations[MisRand][UnloadY];
  48. unz[playerid] = TruckerLocations[MisRand][UnloadZ];
  49. Payment[playerid] = TruckerLocations[MisRand][Pay];
  50. HashtagID[playerid] = TruckerLocations[MisRand][HashID];
  51. SetPlayerCheckpoint(playerid, x, y, z, 7);
  52. format(LoadText, 128, "%s", TruckerLocations[MisRand][LoadName]);
  53. SendClientMessage(playerid, -1, "Mission:");
  54. SendClientMessage(playerid, 0xFFFFFFFF, LoadText);
  55. }
  56. else
  57. {
  58. SendClientMessage(playerid, -1, "You need a correct trailer!");
  59. }
  60. }
  61. else
  62. {
  63. SendClientMessage(playerid, -1, "You need a trailer!");
  64. }
  65. }
  66. else
  67. {
  68. SendClientMessage(playerid, -1, "You must be in a Truck to perform this!");
  69. }
  70. return 1;
  71. }
  72.  
  73. stock StopTask(playerid)
  74. {
  75. DisablePlayerCheckpoint(playerid);
  76. SendClientMessage(playerid, -1, "You chose to cancel the mission and got fined $100");
  77. GivePlayerMoney(playerid, -100);
  78. MissionStatus[playerid] = 0;
  79. return 1;
  80. }
  81.  
  82. stock TruckerCheckpointEntered(playerid)
  83. {
  84. new gString[128];
  85. new VehID = GetPlayerVehicleID(playerid);
  86. if(!IsTrailerAttachedToVehicle(VehID)) return SendClientMessage(playerid, -1, "You need a trailer to unload 2!");
  87. if(MissionStatus[playerid] == 1)
  88. {
  89. DisablePlayerCheckpoint(playerid);
  90. SetPlayerCheckpoint(playerid, unx[playerid], uny[playerid], unz[playerid], 7);
  91. SendClientMessage(playerid, -1, "Loaded. Please head to the second checkpoint!");
  92. MissionStatus[playerid] = 2;
  93. }
  94. else if(MissionStatus[playerid] == 2)
  95. {
  96. DisablePlayerCheckpoint(playerid);
  97. GivePlayerMoney(playerid, Payment[playerid]);
  98. SendClientMessage(playerid, -1, "Well done! You completed the mission!");
  99. format(gString, 512, "%s has completed mission # %d and earned $%d!", pName(playerid), HashtagID, Payment[playerid]);
  100. SendClientMessageToAll(-1, gString);
  101. MissionStatus[playerid] = 0;
  102. }
  103. return 1;
  104. }
  105.  
  106. stock pName(PN)
  107. {
  108. new PX[MAX_PLAYER_NAME];
  109. GetPlayerName(PN, PX, sizeof(PX));
  110. return PX;
  111. }
Advertisement
Add Comment
Please, Sign In to add comment