handles banning a player from the game Usage: "$ban " where pnum is the playernumber of the player to ban
| 355 | // handles banning a player from the game |
| 356 | // Usage: "$ban <int pnum>" where pnum is the playernumber of the player to ban |
| 357 | void DMFCInputCommand_Ban(const char *input_string) { |
| 358 | if (basethis->GetLocalRole() != LR_SERVER) |
| 359 | return; |
| 360 | int p; |
| 361 | char temp[20]; |
| 362 | |
| 363 | // parse "$ban" |
| 364 | if (!StringParseWord(input_string, temp, 20, &input_string)) { |
| 365 | basethis->DisplayInputCommandHelp(DTXT_IC_BAN); |
| 366 | return; |
| 367 | } |
| 368 | |
| 369 | // parse pnum |
| 370 | if (!StringParseNumber(input_string, &p, &input_string)) { |
| 371 | basethis->DisplayInputCommandHelp(DTXT_IC_BAN); |
| 372 | return; |
| 373 | } |
| 374 | |
| 375 | if (!basethis->CheckPlayerNum(p)) |
| 376 | return; |
| 377 | |
| 378 | BanPlayer(p); |
| 379 | if (p != *basethis->Player_num) |
| 380 | DLLAddHUDMessage(DTXT_BANMSG, basethis->Players[p].callsign); |
| 381 | } |
| 382 | |
| 383 | // handles ending the level |
| 384 | // Usage: "$endlevel" |
nothing calls this directly
no test coverage detected