Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case NEGOCJALAK:
- {
- if (frame.iID_receiver == my_vehicle->iID && frame.iID == tim) {
- int procent_otrzymany = frame.transfer_value;
- LPCSTR a;
- std::string s = std::to_string(procent_otrzymany);
- a = (LPCSTR)s.c_str();
- LPCSTR b;
- std::string ss = "Negocjacja";
- b = (LPCSTR)ss.c_str();
- int co_teraz = MessageBox(nullptr, a, b, MB_YESNOCANCEL | MB_ICONQUESTION);
- if ( co_teraz == IDYES) // or IDNO, depending
- {
- Frame frame;
- frame.frame_type = TRANSFER;
- frame.iID_receiver = tim;
- frame.transfer_type = MONEY;
- frame.transfer_value = my_vehicle->state.money * procent_otrzymany / 100;
- frame.iID = my_vehicle->iID;
- multi_send->send((char*)&frame, sizeof(Frame));
- my_vehicle->state.money -= frame.transfer_value;
- }
- if (co_teraz == IDCANCEL) // or IDNO, depending
- {
- Frame frame;
- frame.frame_type = NEGOCJALAK;
- frame.iID_receiver = tim;
- frame.transfer_type = 0;
- frame.transfer_value = procent;
- frame.iID = my_vehicle->iID;
- multi_send->send((char*)&frame, sizeof(Frame));
- }
- }
- break;
- }
- case '8':
- {
- long prev_time = VW_cycle_time;
- VW_cycle_time = clock();
- float fFps = (50 * CLOCKS_PER_SEC) / (float)(VW_cycle_time - prev_time);
- procent += 1;
- 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);
- break;
- }
- case '2':
- {
- long prev_time = VW_cycle_time;
- VW_cycle_time = clock();
- float fFps = (50 * CLOCKS_PER_SEC) / (float)(VW_cycle_time - prev_time);
- procent -= 1;
- 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);
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement