This repository was archived by the owner on Aug 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Expand file tree Collapse file tree 1 file changed +12
-15
lines changed Original file line number Diff line number Diff line change @@ -402,36 +402,33 @@ CON_COMMAND_CHAT(pause, "Request pause")
402402 if (!player)
403403 return ;
404404
405- int iPlayer = player->GetPlayerSlot ();
405+ if (match_paused) {
406+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX" Match already paused" );
407+ return ;
408+ }
406409
407- CBasePlayerController* pPlayer = (CBasePlayerController*)g_pEntitySystem-> GetBaseEntity ((CEntityIndex)(player-> GetPlayerSlot () + 1 )) ;
410+ match_paused = true ;
408411
409412 g_pEngineServer2->ServerCommand (" mp_pause_match" );
410-
411413 ClientPrintAll (HUD_PRINTTALK, CHAT_PREFIX" \4 %s \1 requested a pause" , player->GetPlayerName ());
412-
413- match_paused = true ;
414414 ct_ready = false ;
415415 t_ready = false ;
416416}
417417
418418CON_COMMAND_CHAT (unpause, " Request unpause" )
419419{
420- if (!g_bEnablePause)
420+ if (!g_bEnablePause || !player )
421421 return ;
422422
423- if (!player)
423+ if (!match_paused){
424+ ClientPrint (player, HUD_PRINTTALK, CHAT_PREFIX" Match is not paused yet, type \5 .pause" );
424425 return ;
426+ }
425427
426- if (!match_paused)
427- return ;
428-
429- CBasePlayerController* pPlayer = (CBasePlayerController*)g_pEntitySystem->GetBaseEntity ((CEntityIndex)(player->GetPlayerSlot () + 1 ));
430-
431- int teamSide = pPlayer->m_iTeamNum ();
432- if ( teamSide == CS_TEAM_T && !t_ready){
428+ int teamSide = player->m_iTeamNum ();
429+ if (teamSide == CS_TEAM_T && !t_ready){
433430 t_ready = true ;
434- }else if ( teamSide == CS_TEAM_CT && !ct_ready){
431+ }else if (teamSide == CS_TEAM_CT && !ct_ready){
435432 ct_ready = true ;
436433 }
437434
You can’t perform that action at this time.
0 commit comments