next_token = -1;
index = start_index;
+ selection = world;
if(argc > start_index)
{
tmp_number = stof(argv(index));
++index;
}
+ else
+ tmp_number = 0;
}
else // maybe it's ONLY a number?
{
}
else
{
+ selection = world;
FOR_EACH_CLIENT(tmp_player)
if (strdecolorize(tmp_player.netname) == strdecolorize(input))
selection = tmp_player;
entity selection = GetFilteredEntity(input);
float output;
- if(selection) { output = num_for_edict(selection); }
+ output = num_for_edict(selection);
return output;
}
-// switch between sprint and print depending on whether the reciever is the server or a player
+// switch between sprint and print depending on whether the receiver is the server or a player
void print_to(entity to, string input)
{
if(to)
// used by CommonCommand_timeout() and CommonCommand_timein() to handle game pausing and messaging and such.
void timeout_handler_reset()
{
- entity tmp_player;
-
timeout_caller = world;
timeout_time = 0;
timeout_leadtime = 0;
-
- FOR_EACH_REALPLAYER(tmp_player)
- Send_CSQC_Centerprint_Generic_Expire(tmp_player, CPID_TIMEOUT_COUNTDOWN);
remove(self);
}
{
if(timeout_time > 0) // countdown is still going
{
- FOR_EACH_REALPLAYER(tmp_player)
- Send_CSQC_Centerprint_Generic(tmp_player, CPID_TIMEOUT_COUNTDOWN, "Timeout ends in %d seconds!", 1, timeout_time);
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_ENDING, timeout_time);
if(timeout_time == autocvar_sv_timeout_resumetime) // play a warning sound when only <sv_timeout_resumetime> seconds are left
Announce("prepareforbattle");
{
if(timeout_leadtime > 0) // countdown is still going
{
- // centerprint the information to every player
- FOR_EACH_REALPLAYER(tmp_player)
- Send_CSQC_Centerprint_Generic(tmp_player, CPID_TIMEOUT_COUNTDOWN, "Timeout begins in %d seconds!", 1, timeout_leadtime);
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_TIMEOUT_BEGINNING, timeout_leadtime);
self.nextthink = time + 1; // think again in one second
timeout_leadtime -= 1; // decrease the time counter
float i;
for(i = 0; i < 10; ++i)
- if(records_reply[i])
+ if(records_reply[i] != "")
print_to(caller, records_reply[i]);
return; // never fall through to usage
{
if(caller) { caller.allowed_timeouts -= 1; }
- bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : string_null), "!\n"); // write a bprint who started the timeout (and how many they have left)
+ bprint(GetCallerName(caller), " ^7called a timeout", (caller ? strcat(" (", ftos(caller.allowed_timeouts), " timeout(s) left)") : ""), "!\n"); // write a bprint who started the timeout (and how many they have left)
timeout_status = TIMEOUT_LEADTIME;
timeout_caller = caller;
{
case CMD_REQUEST_COMMAND:
{
- float total_listed_players, tmp_hours, tmp_minutes, tmp_seconds, is_bot;
+ float total_listed_players, is_bot;
entity tmp_player;
float privacy = (caller && autocvar_sv_status_privacy);
string separator = strreplace("%", " ", strcat((argv(1) ? argv(1) : " "), "^7"));
string tmp_netaddress, tmp_crypto_idfp;
- print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : string_null), ":"));
+ print_to(caller, strcat("List of client information", (privacy ? " (some data is hidden for privacy)" : ""), ":"));
print_to(caller, sprintf(strreplace(" ", separator, " %-4s %-20s %-5s %-3s %-9s %-16s %s "),
"ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
+ total_listed_players = 0;
FOR_EACH_CLIENT(tmp_player)
{
is_bot = (clienttype(tmp_player) == CLIENTTYPE_BOT);
tmp_netaddress = tmp_player.netaddress;
tmp_crypto_idfp = tmp_player.crypto_idfp;
}
-
- tmp_hours = tmp_minutes = tmp_seconds = 0;
-
- tmp_seconds = floor(time - tmp_player.jointime);
- tmp_minutes = floor(tmp_seconds / 60);
- tmp_hours = floor(tmp_minutes / 60);
-
- if(tmp_minutes) { tmp_seconds -= (tmp_minutes * 60); }
- if(tmp_hours) { tmp_minutes -= (tmp_hours * 60); }
print_to(caller, sprintf(strreplace(" ", separator, " #%-3d %-20.20s %-5d %-3d %-9s %-16s %s "),
num_for_edict(tmp_player),
tmp_player.netname,
tmp_player.ping,
tmp_player.ping_packetloss,
- sprintf("%02d:%02d:%02d", tmp_hours, tmp_minutes, tmp_seconds),
+ process_time(1, time - tmp_player.jointime),
tmp_netaddress,
tmp_crypto_idfp));
#undef COMMON_COMMAND
return;
-}
\ No newline at end of file
+}