KrisnaPradnya

krisnapradnya3

Jun 1st, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. [PAWN] if(strcmp(cmd, "/sellprods", true) == 0)
  2. {
  3. new cashmade;
  4. new tmpcar;
  5. if(IsPlayerConnected(playerid))
  6. {
  7. tmpcar = GetPlayerVehicleID(playerid);
  8. if(!IsATruck(tmpcar))
  9. {
  10. GameTextForPlayer(playerid, "~r~You are not in a delivery truck", 5000, 1);
  11. return 1;
  12. }
  13. if(PlayerHaul[tmpcar][pLoad] == 0)
  14. {
  15. GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
  16. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  17. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  18. return 1;
  19. }
  20. for(new i = 0; i < sizeof(BizzInfo); i++)
  21. {
  22. if (IsPlayerInRangeOfPoint(playerid, 10,BizzInfo[i][bEntranceX], BizzInfo[i][bEntranceY], BizzInfo[i][bEntranceZ]))
  23. {
  24. //printf("Found House :%d",i);
  25. for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
  26. {
  27. if(BizzInfo[i][bProducts] == BizzInfo[i][bMaxProducts])
  28. {
  29. GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
  30. format(string, sizeof(string), "Cash Earned $%d.", cashmade);
  31. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  32. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  33. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  34. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  35. return 1;
  36. }
  37. if(BizzInfo[i][bPriceProd] > BizzInfo[i][bTill])
  38. {
  39. GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
  40. format(string, sizeof(string), "Cash Earned $%d.", cashmade);
  41. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  42. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  43. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  44. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  45. return 1;
  46. }
  47. PlayerHaul[tmpcar][pLoad]--;
  48. BizzInfo[i][bProducts]++;
  49. cashmade = cashmade+BizzInfo[i][bPriceProd];
  50. //ConsumingMoney[playerid] = 1;
  51. SafeGivePlayerMoney(playerid,BizzInfo[i][bPriceProd]);
  52. BizzInfo[i][bTill] -= BizzInfo[i][bPriceProd];
  53. if(PlayerHaul[tmpcar][pLoad] == 0)
  54. {
  55. GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
  56. format(string, sizeof(string), "Cash Earned $%d.", cashmade);
  57. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  58. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  59. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  60. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  61. return 1;
  62. }
  63. }
  64. OnPropUpdate(3,i);
  65. return 1;
  66. }
  67. }
  68. }
  69. for(new i = 0; i < sizeof(SBizzInfo); i++)
  70. {
  71. if (IsPlayerInRangeOfPoint(playerid, 10,SBizzInfo[i][sbEntranceX], SBizzInfo[i][sbEntranceY], SBizzInfo[i][sbEntranceZ]))
  72. {
  73. //printf("Found House :%d",i);
  74. for(new l = PlayerHaul[tmpcar][pLoad]; l > 0; l--)
  75. {
  76. if(SBizzInfo[i][sbProducts] == SBizzInfo[i][sbMaxProducts])
  77. {
  78. GameTextForPlayer(playerid, "~r~Our stores are full", 5000, 1);
  79. format(string, sizeof(string), "Cash Earned $%d.", cashmade);
  80. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  81. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  82. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  83. return 1;
  84. }
  85. if(SBizzInfo[i][sbPriceProd] > SBizzInfo[i][sbTill])
  86. {
  87. GameTextForPlayer(playerid, "~r~We Cant Afford The Deal", 5000, 1);
  88. format(string, sizeof(string), "Cash Earned $%d.", cashmade);
  89. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  90. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  91. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  92. return 1;
  93. }
  94. PlayerHaul[tmpcar][pLoad]--;
  95. SBizzInfo[i][sbProducts]++;
  96. cashmade = cashmade+SBizzInfo[i][sbPriceProd];
  97. //ConsumingMoney[playerid] = 1;
  98. SafeGivePlayerMoney(playerid,SBizzInfo[i][sbPriceProd]);
  99. SBizzInfo[i][sbTill] -= SBizzInfo[i][sbPriceProd];
  100. if(PlayerHaul[tmpcar][pLoad] == 0)
  101. {
  102. GameTextForPlayer(playerid, "~r~Truck is empty, return to the stock house", 5000, 1);
  103. format(string, sizeof(string), "Cash Earned $%d.", cashmade);
  104. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  105. format(string, sizeof(string), "Products: %d/%d.", PlayerHaul[tmpcar][pLoad],PlayerHaul[tmpcar][pCapasity]);
  106. SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
  107. return 1;
  108. }
  109. }
  110. OnPropUpdate(3,i);
  111. return 1;
  112. }
  113. }
  114. GameTextForPlayer(playerid, "~r~To Far From A Business", 5000, 1);
  115. return 1;
  116. }[/PAWN]
Advertisement
Add Comment
Please, Sign In to add comment