Recovered from the archived server. This was never posted on the forum, so there is no thread behind it and no author post to quote — the attribution below comes from the plugin's own register_plugin() call where it has one.
slots_reservation
by Unknown · 2004-11-04
recovered from the server
From the first post
Files
| slots_reservation.amxx | Compiled Plugin | 3 KB | Download |
Decompiled source reconstructed
slots_reservation.amxx was published compiled only. This Pawn was recovered from the
bytecode with Lysis — 140 lines. Strings, cvars and the plugin registration
survive; local variable names do not. It is an approximation, not the author's file.
// Decompiled from slots_reservation.amxx by Lysis.n// This is RECONSTRUCTED source, not the author's original: withoutn// debug symbols the variable names are lost and control flow isn// rebuilt from bytecode. Treat it as a readable approximation.nnpublic client_authorized(_arg0)n{n new var1;n var1 = get_maxplayers();n new var2;n var2 = get_playersnum(1);n new var3;n var3 = var1 + -1;n new var4;n var4 = get_cvar_num("amx_reservation");n new var5 = 0;n if (var2 > var3)n {n if (get_user_flags(_arg0, "Slots Reservation") & 2)n {n switch (var4)n {n case 1:n {n var5 = sub_c28();n }n case 2:n {n var5 = sub_820();n }n default:n {n }n }n if (var5)n {n new var6 = 0;n get_user_name(var5, var6, 31);n client_cmd(_arg0, "echo "* %s was kicked to free this slot"", var6);n }n return 0;n }n if (is_user_bot(_arg0))n {n server_cmd("kick #%d", get_user_userid(_arg0));n }n elsen {n client_cmd(_arg0, "echo "Server is Full.";disconnect");n }n return 1;n }n return 0;n}nnpublic plugin_init()n{n register_plugin("Slots Reservation", "0.9.7", "f117bomb");n register_cvar("amx_reservation", 196, "Slots Reservation", "Slots Reservation");n return 0;n}nnsub_c28()n{n new var2 = 0;n new var3 = 0;n new var4 = 2147483647;n new var5;n var5 = get_maxplayers();n new var6 = 1;n while (var6 <= var5)n {n new var1;n if (!is_user_connected(var6) && !is_user_connecting(var6))n {n }n elsen {n if (!(get_user_flags(var6, "Slots Reservation") & 2))n {n var3 = get_user_time(var6, "Slots Reservation");n if (var4 > var3)n {n var4 = var3;n var2 = var6;n }n }n }n var6++;n }n if (var2)n {n if (is_user_bot(var2))n {n server_cmd("kick #%d", get_user_userid(var2));n }n client_cmd(var2, "echo "Dropped due to shortest playing time to free slot for an admin";disconnect");n }n return var2;n}nnsub_820()n{n new var2 = 0;n new var3 = 0;n new var4 = -1;n new var5;n var5 = get_maxplayers();n new var6 = 1;n while (var6 <= var5)n {n new var1;n if (!is_user_connected(var6) && !is_user_connecting(var6))n {n }n elsen {n if (!(get_user_flags(var6, "Slots Reservation") & 2))n {n get_user_ping(var6, var3, _unused_temp_);n if (var3 > var4)n {n var4 = var3;n var2 = var6;n }n }n }n var6++;n }n if (var2)n {n if (is_user_bot(var2))n {n server_cmd("kick #%d", get_user_userid(var2));n }n client_cmd(var2, "echo "Dropped due to high ping to free slot for an admin";disconnect");n }n return var2;n}nn

