•  
     

sXe Injected Managner

This is a small plugin that will help many administrators who use sXe injected on their servers using a menus, the original plugin for sXe injected Sucks


[ADMIN_MENU]
> amx_sxe_menu - Main Menu for sXe Injected (Ban and Screenshot command).

[ADMIN_KICK]
> amx_sxe_ss_menu - Take a Screenshot of choosed player.

[ADMIN_BAN]
> amx_sxe_ban_menu - Ban any player using Hardware ID.



Código: Selecionar todos


#include <amxmodx>
#include <amxmisc>

#pragma semicolon 1

new const Head[] = "[sXe Injected]";

public plugin_init()
{
	register_plugin("sXe Injected Managner",AMXX_VERSION_STR,"SmileY");
	
	register_clcmd("amx_sxe_menu","sXeMenu",ADMIN_MENU,"[sXe Injected] Main Menu for sXe Injected");
	register_clcmd("amx_sxe_ss_menu","sXeSSMenu",ADMIN_KICK,"[sXe Injected] Take a Screenshot of choosed player");
	register_clcmd("amx_sxe_ban_menu","sXeBanMenu",ADMIN_BAN,"[sXe Injected] Ban any player via Hardware ID");
}

public sXeMenu(id,level,cid)
{
	if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;
	
	new m_sXe = menu_create("sXe Injected Menu:","sXeHandler");
	
	menu_additem(m_sXe,"sXe Screenshot","0",0);
	menu_additem(m_sXe,"sXe Hardware Ban","1",0);
	
	menu_display(id,m_sXe,0);
	return PLUGIN_HANDLED;
}
	
public sXeHandler(id,m_sXe,item)
{
	if(item == MENU_EXIT) return PLUGIN_HANDLED;
	
	new data[6],szName[32];
	new access,callback;
	menu_item_getinfo(m_sXe,item,access,data,charsmax(data),szName,charsmax(szName),callback);
	
	switch(str_to_num(data))
	{
		case 0:
		{
			client_cmd(id,"amx_sxe_ss_menu");
			return PLUGIN_HANDLED;
		}
		case 1:
		{
			client_cmd(id,"amx_sxe_ban_menu");
			return PLUGIN_HANDLED;
		}
	}
	return PLUGIN_HANDLED;
}
	
public sXeSSMenu(id,level,cid)
{
	if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;
	
	new m_SS = menu_create("sXe Screen Shot:","SSHandler");
	new Name[32],ID[10];
	
	new iPlayers[32],iNum,Players;
	get_players(iPlayers,iNum,"ch");
	
	for(new i;i < iNum;i++)
	{
		Players = iPlayers[i];
		
		if(Players == id) continue;
		
		get_user_name(Players,Name,charsmax(Name));
		num_to_str(Players,ID,charsmax(ID));
		
		menu_additem(m_SS,Name,ID,0);
	}
	menu_display(id,m_SS,0);
	return PLUGIN_HANDLED;
}

public SSHandler(id,m_SS,item)
{
	if(item == MENU_EXIT) return PLUGIN_HANDLED;
	
	new data[6],szName[32];
	new access,callback;
	menu_item_getinfo(m_SS,item,access,data,charsmax(data),szName,charsmax(szName),callback);
	
	new ID = str_to_num(data);
	
	if(!is_user_connected(ID))
	{
		client_print(id,print_chat,"%s Sorry, user disconnected..",Head);
		return PLUGIN_HANDLED;
	}
	server_cmd("sxe_screen #%d #%d", get_user_userid(ID), get_user_userid(id));
	
	client_print(id,print_chat,"%s Uploading screenshot.",Head);
	
	menu_destroy(m_SS);
	return PLUGIN_HANDLED;
}

public sXeBanMenu(id,level,cid)
{
	if(!cmd_access(id,level,cid,1)) return PLUGIN_HANDLED;
	
	new m_Ban = menu_create("sXe Ban Menu:","BanHandler");
	
	new Name[32],ID[10];
	
	new iPlayers[32],iNum,Players;
	get_players(iPlayers,iNum,"ch");
	
	for(new i;i < iNum;i++)
	{
		Players = iPlayers[i];
		
		if(Players == id) continue;
		
		get_user_name(Players,Name,charsmax(Name));
		num_to_str(Players,ID,charsmax(ID));
		
		menu_additem(m_Ban,Name,ID,0);
	}
	menu_display(id,m_Ban,0);
	return PLUGIN_HANDLED;
}

public BanHandler(id,m_Ban,item)
{
	if(item == MENU_EXIT) return PLUGIN_HANDLED;
	
	new data[6],szName[32];
	new access,callback;
	menu_item_getinfo(m_Ban,item,access,data,charsmax(data),szName,charsmax(szName),callback);
	
	new ID = str_to_num(data);

	if(!is_user_connected(ID))
	{
		client_print(id,print_chat,"%s Sorry, user disconnected.",Head);
		return PLUGIN_HANDLED;
	}
	new Name[32];
	get_user_name(ID,Name,charsmax(Name));
	
	client_print(0,print_chat,"%s %s Has been BANNED by Hardware ID.",Head,Name);
	
	server_cmd("sxe_ban #%d",get_user_userid(ID));
	
	menu_destroy(m_Ban);
	return PLUGIN_HANDLED;
}