Advertisement
qtinio

hm

Apr 24th, 2019
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. case NEGOCJALAK:
  2. {
  3. if (frame.iID_receiver == my_vehicle->iID && frame.iID == tim) {
  4.  
  5. int procent_otrzymany = frame.transfer_value;
  6. LPCSTR a;
  7. std::string s = std::to_string(procent_otrzymany);
  8. a = (LPCSTR)s.c_str();
  9. LPCSTR b;
  10. std::string ss = "Negocjacja";
  11. b = (LPCSTR)ss.c_str();
  12. int co_teraz = MessageBox(nullptr, a, b, MB_YESNOCANCEL | MB_ICONQUESTION);
  13. if ( co_teraz == IDYES) // or IDNO, depending
  14. {
  15. Frame frame;
  16. frame.frame_type = TRANSFER;
  17. frame.iID_receiver = tim;
  18. frame.transfer_type = MONEY;
  19. frame.transfer_value = my_vehicle->state.money * procent_otrzymany / 100;
  20. frame.iID = my_vehicle->iID;
  21. multi_send->send((char*)&frame, sizeof(Frame));
  22. my_vehicle->state.money -= frame.transfer_value;
  23. }
  24. if (co_teraz == IDCANCEL) // or IDNO, depending
  25. {
  26. Frame frame;
  27. frame.frame_type = NEGOCJALAK;
  28. frame.iID_receiver = tim;
  29. frame.transfer_type = 0;
  30. frame.transfer_value = procent;
  31. frame.iID = my_vehicle->iID;
  32. multi_send->send((char*)&frame, sizeof(Frame));
  33. }
  34. }
  35. break;
  36. }
  37.  
  38.  
  39. case '8':
  40. {
  41. long prev_time = VW_cycle_time;
  42. VW_cycle_time = clock();
  43. float fFps = (50 * CLOCKS_PER_SEC) / (float)(VW_cycle_time - prev_time);
  44. procent += 1;
  45. sprintf(par_view.inscription1, " %0.0f_fps, fuel = %0.2f, money = %d\n, negocjacja = %i %%\n", fFps, my_vehicle->state.amount_of_fuel, my_vehicle->state.money, procent);
  46. break;
  47. }
  48. case '2':
  49. {
  50. long prev_time = VW_cycle_time;
  51. VW_cycle_time = clock();
  52. float fFps = (50 * CLOCKS_PER_SEC) / (float)(VW_cycle_time - prev_time);
  53. procent -= 1;
  54. sprintf(par_view.inscription1, " %0.0f_fps, fuel = %0.2f, money = %d\n, negocjacja = %i %%\n", fFps, my_vehicle->state.amount_of_fuel, my_vehicle->state.money, procent);
  55. break;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement