Quote:
Originally Posted by hatch
the reason this plugin is useful is for servers like deathrun where if the T disconnects it restarts the whole game and ruins the fun for players so as punishment for the player who left as a T they get banned for say 15 or 30 min. I just wish with this plugin we could specify the team to apply this to. Like only ban T disconnects.
|
This is my first plugin
Try this for deathrun:
Cvar: deathrun_disc_ban 1 [on] / 0 [off]
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new cvar;
public plugin_init() {
cvar = register_cvar("deathrun_disc_ban", "1");
}
public client_disconnect(iPlayer) {
new szName[32], szSteamID[35];
if(get_pcvar_num(cvar) && is_user_connected(iPlayer) && cs_get_user_team(iPlayer) == CS_TEAM_T) {
get_user_name(iPlayer, szName, charsmax(szName));
get_user_authid(iPlayer, szSteamID, charsmax(szStamID));
server_cmd("amx_addban ^"%s^" ^"%s^" 60 ^"Disconnected^"", szName, szSteamID);
}
}
__________________