Guest User

Untitled

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. stock PrekesPirkimas( playerid, bool:type, price, business, productID, amount )
  2. {
  3. if( !type )
  4. {
  5. if( bInfo[ business ][ Product ][ productID ] > amount )
  6. {
  7. if( GetPlayerMoney( playerid ) > price )
  8. {
  9. GivePlayerMoneyA( playerid, -price );
  10. bInfo[ business ][ Product ][ productID ] -= amount;
  11. bInfo[ business ][ profit ] += floatround( price/2 );
  12. }
  13. else
  14. {
  15. SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Atsipraðome, jums neuþtenka pinigø.");
  16. return false;
  17. }
  18. }
  19. else
  20. {
  21. SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Prekës(-iø) ðiuo metu nëra.");
  22. return false;
  23. }
  24. }
  25. else
  26. {
  27. if( pDB[ playerid ][ bankok ] )
  28. {
  29. if( bInfo[ business ][ Product ][ productID ] > amount )
  30. {
  31. if( pDB[ playerid ][ bankas ] > price )
  32. {
  33. pDB[ playerid ][ bankas ] -= price;
  34. bInfo[ business ][ Product ][ productID ] -= amount;
  35. bInfo[ business ][ profit ] += floatround( price/2 );
  36. }
  37. else
  38. {
  39. SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Atsipraðome, jûs banke tiek neturite.");
  40. return false;
  41. }
  42. }
  43. else
  44. {
  45. SendClientMessage(playerid, WHITE, "[ > ]{FF7E7E} Prekës(-iø) ðiuo metu nëra.");
  46. return false;
  47. }
  48. }
  49. else
  50. {
  51. SendClientMessage( playerid, WHITE, "[ > ]{FF7E7E} Atsipraðome, jûs neturite banko sàskaitos." );
  52. return false;
  53. }
  54. }
  55. return true;
  56. }
Add Comment
Please, Sign In to add comment