Connorlolz

Untitled

May 12th, 2014
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. public Cooldown(playerid)
  2. {
  3. if(PVar[playerid][WorkMinutes] > 0)
  4. {
  5. PVar[playerid][WorkMinutes] -= 1;
  6. SetTimerEx("Cooldown", 60000, false, "i", playerid);
  7. }
  8. SendClientMessage(playerid, -1, "You can work again.");
  9. return 1;
  10. }
  11.  
  12. public IceCream(playerid)
  13. {
  14. if(!IsPlayerInRangeOfPoint(playerid, 35, PVar[playerid][X], PVar[playerid][Y], PVar[playerid][Z]))
  15. {
  16. if(PVar[playerid][WorkMinutes] == 15)
  17. {
  18. new vehid;
  19. SendClientMessage(playerid, -1, "You're done with ice cream.");
  20. vehid = GetPlayerVehicleID(playerid);
  21. RemovePlayerFromVehicle(playerid);
  22. SetVehiclePos(vehid, VVar[vehid][VehiclePosX], VVar[vehid][VehiclePosY], VVar[vehid][VehiclePosZ]);
  23. SetVehicleZAngle(vehid, VVar[vehid][VehicleAngle]);
  24. SetTimerEx("Cooldown", 6000, false, "i", playerid);
  25. PVar[playerid][Working] = false;
  26. }
  27. if(!IsPlayerInAnyVehicle(playerid))
  28. return 1;
  29.  
  30. if(VVar[GetPlayerVehicleID(playerid)][JobLockedID] == 3)
  31. {
  32. new Float: x, Float: y, Float: z;
  33. GetPlayerPos(playerid, x, y, z);
  34. PVar[playerid][Money] += 35;
  35. SendClientMessage(playerid, -1, "You've sold some ice cream!");
  36. PVar[playerid][WorkMinutes] += 1;
  37. PVar[playerid][X] = x;
  38. PVar[playerid][Y] = y;
  39. PVar[playerid][Z] = z;
  40. SetTimerEx("IceCream", 60000, false, "i", playerid);
  41. }
  42. }
  43. return 1;
  44. }
  45.  
  46. CMD:stopicecream(playerid)
  47. {
  48. if(PVar[playerid][Job] != 3)
  49. return SendClientMessage(playerid, -1, "You don't have the ice cream job!");
  50.  
  51. if(PVar[playerid][Working] == false)
  52. return 1;
  53.  
  54. PVar[playerid][Working] = false;
  55. SendClientMessage(playerid, -1, "You've stopped working.");
  56. PVar[playerid][WorkMinutes] = 15;
  57. return 1;
  58. }
  59.  
  60. CMD:starticecream(playerid)
  61. {
  62. if(PVar[playerid][Job] != 3)
  63. return SendClientMessage(playerid, -1, "You don't have the ice cream job!");
  64.  
  65. if(VVar[GetPlayerVehicleID(playerid)][JobLockedID] != 3)
  66. return SendClientMessage(playerid, -1, "You are't in an ice cream truck!");
  67.  
  68. if(PVar[playerid][Working] == true)
  69. return SendClientMessage(playerid, -1, "You're already working!");
  70.  
  71. SendClientMessage(playerid, YELLOW, "You are now doing some ice cream things! Drive around town!");
  72. new Float: x, Float: y, Float: z;
  73. GetPlayerPos(playerid, x, y, z);
  74. PVar[playerid][Working] = true;
  75. PVar[playerid][X] = x;
  76. PVar[playerid][Y] = y;
  77. PVar[playerid][Z] = z;
  78. SetTimerEx("IceCream", 60000, false, "i", playerid);
  79. return 1;
  80. }
Advertisement
Add Comment
Please, Sign In to add comment