Raised This Month: $ Target: $400
 0% 

[REQ] Edit and Add


Post New Thread Reply   
 
Thread Tools Display Modes
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 02-25-2015 , 09:00   Re: [REQ] Edit and Add
Reply With Quote #11

Fixed the ban by checking my jailbreak menu.
And the gagmenu should work. You need to set the right admin flag in the gagmenu. Because it should open if the gagmenu is right installed.
The gagmenu should open when you chose it in the menu or write amx_gagmenu in the console

Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <nvault>
#include <colorchat>

#define PLUGIN "Admin Menu HNS (AmxBans)"
#define VERSION "2.0"
#define AUTHOR "SnusMumrikeN"

#define TAG "[MD]"
#define ADMIN_LEVEL ADMIN_BAN

new const BanName[][64] = {
	"1 Hour",
	"2 Hour",
	"Day",
	"Week",
	"Month"
}
new const BanTime[][64] = {
	60,
	120,
	1440,
	10080,
	43200
}

new Style[ 33 ], Reason[ 33 ][ 51 ], Name[ 33 ], g_BanTime[ 33 ]
new gVault, g_iWarningsCount[ 33 ], gSteamID[ 32 ], vKey[ 64 ], vData[ 64 ];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd ( "say /admin", "CmdMainMenu" )
	register_clcmd ( "type_reason", "CmdReason" )
	
	register_clcmd("nightvision", "CmdMainMenu");
}

public CmdMainMenu(id) 
{
	if(!(get_user_flags( id ) & ADMIN_LEVEL ) )  
	{
		ColorChat(id, GREY, "^4%s^3 You need to be^4 admin^3 to use this menu!", TAG)
		return PLUGIN_HANDLED
	}
	
	new title[512]; formatex(title, sizeof(title) - 1, "\r%s\y Admin Menu^n Choose a Category", TAG )
	
	new menu = menu_create(title, "MainMenuHandle");
	
	//Create Items Menu
	menu_additem(menu, "Slay Player", "1", 0);
	menu_additem(menu, "Kick Player", "2", 0);
	menu_additem(menu, "Ban Player", "3", 0);
	menu_additem(menu, "Gag Player", "4", 0);
	menu_additem(menu, "Give Player Warning", "5", 0);
	menu_additem(menu, "Change Player Nick", "6", 0);  
	menu_additem(menu, "Transfer Player", "7", 0); 
	
	//Display the menu
	menu_display(id, menu, 0);
	return PLUGIN_HANDLED
}
 
public MainMenuHandle(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	
	new Name[64];
	get_user_name(id, Name, 63)
	
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	switch(key)
	{
		case 1: 
		{
			Style[id] = 0 // Slay
			PlayerList(id)
		}
		case 2: 		
		{
			Style[id] = 1 // Kick
			PlayerList(id)
		}
		case 3: 		
		{
			Style[id] = 2 // Ban
			PlayerList(id)
		}
		case 4: client_cmd(id, "amx_gagmenu"); //Gag
		case 5: 		
		{
			Style[id] = 3 // Warning
			PlayerList(id)
		}
		case 6: 		
		{
			Style[id] = 4 // Nick
			PlayerList(id)
		}
		case 7: 		
		{
			Style[id] = 5 // Transfer
			PlayerList(id)
		}
	}
	return PLUGIN_HANDLED;
}

public PlayerList(id) {
	new Playermenu, Temp[64]
	
	formatex(Temp,63, "\r%s\y Admin Menu^n Choose a Player", TAG )
	Playermenu = menu_create(Temp, "PlayerHandler");
	
	new players[32], pnum, tempid;
	new szName[32], szTempid[10];
	
	get_players(players, pnum, "ch");
	for( new i; i<pnum; i++ ) 
	{
		tempid = players[i];
			
		get_user_name(tempid, szName, charsmax(szName));
		num_to_str(tempid, szTempid, charsmax(szTempid));
		
		formatex(Temp, charsmax( Temp ), "%s%s", szName, get_user_flags( tempid ) & ADMIN_LEVEL ? " - \d[\rImmunity\d]" : "");
		menu_additem(Playermenu, Temp, szTempid, 0);
	}
	
	menu_display(id, Playermenu);
	return PLUGIN_HANDLED;
}

public PlayerHandler(id, menu, item) {
	if( item == MENU_EXIT ) 
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	Name[id] = str_to_num(data);
	
	if(get_user_flags( Name[id] ) & ADMIN_LEVEL && id != Name[id] && get_user_flags( id ) & ADMIN_RCON)  
	{
		ColorChat(id, GREY, "^4%s^3 You cant do actions on a^4 admin^3", TAG)
		CmdMainMenu(id)
		return PLUGIN_HANDLED
	}
	
	if(Style[id] != 2) client_cmd(id, "messagemode type_reason")
	else BanList(id);	
		
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public BanList(id) {
	new menu, Temp[64]
	formatex(Temp,63, "\r%s\y Admin Menu^n Choose Time", TAG )
	menu = menu_create(Temp, "BanHandler");
	
	new key[20]
	for(new i=0; i < sizeof(BanName); i++) 
	{		
		num_to_str(i,key,sizeof(key)-1)
		menu_additem(menu, BanName[i], key);
	}
	menu_display(id, menu, 0);
}
public BanHandler(id, menu, key) {
	if( key == MENU_EXIT ) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	g_BanTime[id] = key

	client_cmd(id, "messagemode type_reason");
	
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public CmdReason(id) {
	if((get_user_flags( id ) & ADMIN_LEVEL ) )  
	{
		new zReason[50]
		read_argv(1,zReason,49)
		copy(Reason[id],49, zReason)

		switch(Style[id])
		{
			case 0: SlayPlayer(id) 		// Slay
			case 1: KickPlayer(id) 		// Kick
			case 2: BanPlayer(id)  		// Ban
			case 3: WarnPlayer(id)		// Warning
			case 4: ChangeNickPlayer(id)	// Nick
			case 5: TransferPlayer(id)	// Transfer
		}
	}
}

public SlayPlayer(id) {
	new name[32], name2[32]
	get_user_name(id, name, 31)
	get_user_name(Name[id], name2, 31)
	
	if(is_user_alive(Name[id])) 
	{
			user_kill(Name[id])
			ColorChat(0, GREY, "^4%s %s^3 slayed^4 %s^3 for ^4%s", TAG, name, name2, Reason[id])
			return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is already dead", TAG, name2)
	
	return PLUGIN_HANDLED;
}
public KickPlayer(id) {
	new name[32], name2[32]
	get_user_name(id, name, 31)
	get_user_name(Name[id], name2, 31)
	
	if(is_user_connected(Name[id])) 
	{	
		client_cmd(id, "amx_kick #%d ^"Kicked by %s. Reason: %s^"",get_user_userid(Name[id]), name, Reason[id])
		
		ColorChat(0, GREY, "^4%s %s^3 kicked^4 %s^3 for ^4%s", TAG, name, name2, Reason[id])
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, name2)

	return PLUGIN_HANDLED;
}
public BanPlayer(id) {
	new name[32], name2[32]
	get_user_name(id, name, 31)
	get_user_name(Name[id], name2, 31)
	
	if(is_user_connected(Name[id])) 
	{	
		client_cmd(id, "amx_ban %d #%d ^"%s^"", BanTime[g_BanTime[id]], get_user_userid(Name[id]), Reason[id])
		
		ColorChat(0, GREY, "^4%s %s^3 banned^4 %s^3 for ^4%s^3 (^4^%s^3)", TAG, name, name2, Reason[id], BanName[g_BanTime[id]])
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, name2)
	return PLUGIN_HANDLED;

}
public ChangeNickPlayer(id) {
	new name[32], name2[32]
	get_user_name(id, name, 31)
	get_user_name(Name[id], name2, 31)
	
	if(is_user_connected(Name[id])) 
	{	
		set_user_info(Name[id],"name",Reason[id]) 
		
		ColorChat(0, GREY, "^4%s %s^3 changed^4 %s^3 name to ^4%s", TAG, name, name2, Reason[id])
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, name2)

	return PLUGIN_HANDLED;
}
public TransferPlayer(id) {
	new name[32], name2[32]
	get_user_name(id, name, 31)
	get_user_name(Name[id], name2, 31)
	
	if(is_user_alive(Name[id])) 
	{
			cs_set_user_team(Name[id], cs_get_user_team(Name[id]) == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T);
			ExecuteHamB(Ham_CS_RoundRespawn, Name[id]);
			ColorChat(0, GREY, "^4%s %s^3 transfered^4 %s^3 to the other team. For ^4%s", TAG, name, name2, Reason[id])
			return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is already dead", TAG, name2)
	
	return PLUGIN_HANDLED;
}

public WarnPlayer(id) {
	new name[32], name2[32]
	get_user_name(id, name, 31)
	get_user_name(Name[id], name2, 31)
	new szAuthID[32]; get_user_authid(Name[id], szAuthID, 31);
	
	if(is_user_connected(Name[id])) 
	{
		g_iWarningsCount[Name[id]] += 1;
		ColorChat(0, GREY, "^4%s %s^3 gave^4 %s^3 a warning for ^4%s^3 Total Warnings:^4 %i", TAG, name, name2, Reason[id], g_iWarningsCount[Name[id]])
		
		if(g_iWarningsCount[Name[id]] == 5) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 1 day^3 for having^4 5 warnings", TAG, name2, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 1440 %s 5warnings", szAuthID)
			return PLUGIN_HANDLED;
		}
		else if(g_iWarningsCount[Name[id]] == 10) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 1 week^3 for having^4 10 warnings", TAG, name2, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 10080 %s 10warnings", szAuthID)	
			return PLUGIN_HANDLED;
		}
		else if(g_iWarningsCount[Name[id]] == 20) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 1 month^3 for having^4 20 warnings", TAG, name2, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 43200 %s 20warnings", szAuthID)				
			return PLUGIN_HANDLED;
		}
		else if(g_iWarningsCount[Name[id]] == 30) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 PERMANENT^3 for having^4 30 warnings", TAG, name2, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 0 %s 30warnings", szAuthID)				
			return PLUGIN_HANDLED;
		}
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, name2)

	return PLUGIN_HANDLED;
}


public client_connect( id )
	load_warnings( id )

public client_disconnect( id )
	save_warnings( id )
		
stock save_warnings( index )
{
	gVault = nvault_open( "Warnings" )
	
	if( gVault == INVALID_HANDLE )
	{
		set_fail_state( "[Warnings] nValut ERROR: =-> Invalid-Handle" )
	}
	
	get_user_authid( index, gSteamID, charsmax( gSteamID ) )
	
	formatex( vKey, charsmax( vKey ), "%sWARNINGS", gSteamID )
	formatex( vData, charsmax( vData ), "%d", g_iWarningsCount[ index ] )
	nvault_set( gVault, vKey, vData )
	nvault_close( gVault )
}

stock load_warnings( index )
{
	gVault = nvault_open( "Warnings" )
	
	if( gVault == INVALID_HANDLE )
	{
		set_fail_state( "[Warnings] nValut ERROR: =-> Invalid-Handle" )
	}
	
	get_user_authid( index, gSteamID, charsmax( gSteamID ) )
	
	formatex( vKey, charsmax( vKey ), "%sWARNINGS", gSteamID )
	g_iWarningsCount[ index ] = nvault_get( gVault, vKey )
	nvault_close( gVault )
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.

Last edited by ironskillz1; 02-25-2015 at 09:04.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
jingojang
Senior Member
Join Date: Feb 2010
Location: The Moon
Old 03-02-2015 , 13:13   Re: [REQ] Edit and Add
Reply With Quote #12

Thank you,

I thought the gag code was implemented. But again, thanks.

Regards,
Jingo
__________________
jingojang is offline
jingojang
Senior Member
Join Date: Feb 2010
Location: The Moon
Old 03-04-2015 , 06:04   Re: [REQ] Edit and Add
Reply With Quote #13

Hi again ironskillz,

I was wondering if I can request that you add some logs that logs all actions and typed in reasons from admins towards the users? Just to make it easier to notice admin abusers.

Regards,
Jingo
__________________

Last edited by jingojang; 03-04-2015 at 06:05.
jingojang is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 03-04-2015 , 10:38   Re: [REQ] Edit and Add
Reply With Quote #14

Quote:
Originally Posted by jingojang View Post
Hi again ironskillz,

I was wondering if I can request that you add some logs that logs all actions and typed in reasons from admins towards the users? Just to make it easier to notice admin abusers.

Regards,
Jingo
Sure mate.

I will probably optimize it a bit too. This plugin was made early 2014 so my coding skills wasnt so good at that time. I think someday this week i can upload a optimized version with logs and maybe inbuilt gagmenu?
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
jingojang
Senior Member
Join Date: Feb 2010
Location: The Moon
Old 03-08-2015 , 18:18   Re: [REQ] Edit and Add
Reply With Quote #15

Quote:
Originally Posted by ironskillz1 View Post
Sure mate.

I will probably optimize it a bit too. This plugin was made early 2014 so my coding skills wasnt so good at that time. I think someday this week i can upload a optimized version with logs and maybe inbuilt gagmenu?
I would appreciate it very much. You do not have to put effort into embeding the gagmenu, I dont mind using xPaws plugin externally. But thank you anyways.

Regards,
Jingo
__________________
jingojang is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 03-09-2015 , 10:03   Re: [REQ] Edit and Add
Reply With Quote #16

Didnt add the gagmenu. optimize a little bit i hope it doesnt cause errors ingame.
Added logs to.


Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <nvault>
#include <colorchat>

#define PLUGIN "Admin Menu HNS (AmxBans)"
#define VERSION "2.0"
#define AUTHOR "SnusMumrikeN"

#define TAG "[MD]"
#define ADMIN_LEVEL ADMIN_BAN

new const BanName[][64] = {
	"1 Hour",
	"2 Hour",
	"Day",
	"Week",
	"Month"
}
new const BanTime[][64] = {
	60,
	120,
	1440,
	10080,
	43200
}

new Style[ 33 ], Reason[ 33 ][ 51 ], Name[ 33 ], g_BanTime[ 33 ], Name2[ 33 ], Name3[ 33 ]  
new gVault, g_iWarningsCount[ 33 ], gSteamID[ 32 ], vKey[ 64 ], vData[ 64 ];

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	register_clcmd ( "say /admin", "CmdMainMenu" )
	register_clcmd ( "type_reason", "CmdReason" )
	
	register_clcmd( "nightvision", "CmdMainMenu" );
}

public CmdMainMenu(id) 
{
	if(!(get_user_flags( id ) & ADMIN_LEVEL ) )  
	{
		ColorChat(id, GREY, "^4%s^3 You need to be^4 admin^3 to use this menu!", TAG)
		return PLUGIN_HANDLED
	}
	
	new title[512]; formatex(title, sizeof(title) - 1, "\r%s\y Admin Menu^n Choose a Category", TAG )
	
	new menu = menu_create(title, "MainMenuHandle");
	
	//Create Items Menu
	menu_additem(menu, "Slay Player", "1", 0);
	menu_additem(menu, "Kick Player", "2", 0);
	menu_additem(menu, "Ban Player", "3", 0);
	menu_additem(menu, "Gag Player", "4", 0);
	menu_additem(menu, "Give Player Warning", "5", 0);
	menu_additem(menu, "Change Player Nick", "6", 0);  
	menu_additem(menu, "Transfer Player", "7", 0); 
	
	//Display the menu
	menu_display(id, menu, 0);
	return PLUGIN_HANDLED
}
 
public MainMenuHandle(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	new key = str_to_num(data);
	switch(key)
	{
		case 1: 
		{
			Style[id] = 0 // Slay
			PlayerList(id)
		}
		case 2: 		
		{
			Style[id] = 1 // Kick
			PlayerList(id)
		}
		case 3: 		
		{
			Style[id] = 2 // Ban
			PlayerList(id)
		}
		case 4: client_cmd(id, "amx_gagmenu"); //Gag
		case 5: 		
		{
			Style[id] = 3 // Warning
			PlayerList(id)
		}
		case 6: 		
		{
			Style[id] = 4 // Nick
			PlayerList(id)
		}
		case 7: 		
		{
			Style[id] = 5 // Transfer
			PlayerList(id)
		}
	}
	return PLUGIN_HANDLED;
}

public PlayerList(id) {
	new Playermenu, Temp[64]
	
	formatex(Temp, charsmax(Temp), "\r%s\y Admin Menu^n Choose a Player", TAG )
	Playermenu = menu_create(Temp, "PlayerHandler");
	
	new players[32], pnum, tempid;
	new szName[32], szTempid[10];
	
	get_players(players, pnum, "ch");
	for( new i; i<pnum; i++ ) 
	{
		tempid = players[i];
			
		get_user_name(tempid, szName, charsmax(szName));
		num_to_str(tempid, szTempid, charsmax(szTempid));
		
		formatex(Temp, charsmax( Temp ), "%s%s", szName, get_user_flags( tempid ) & ADMIN_LEVEL ? " - \d[\rImmunity\d]" : "");
		menu_additem(Playermenu, Temp, szTempid, 0);
	}
	
	menu_display(id, Playermenu);
	return PLUGIN_HANDLED;
}

public PlayerHandler(id, menu, item) {
	if( item == MENU_EXIT ) 
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	
	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
	
	Name[id] = str_to_num(data);
	
	if(get_user_flags( Name[id] ) & ADMIN_LEVEL && id != Name[id] && get_user_flags( id ) & ADMIN_RCON)  
	{
		ColorChat(id, GREY, "^4%s^3 You cant do actions on a^4 admin^3", TAG)
		CmdMainMenu(id)
		return PLUGIN_HANDLED
	}
	
	if(Style[id] != 2) client_cmd(id, "messagemode type_reason")
	else BanList(id);	
		
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public BanList(id) {
	new menu, Temp[64]
	formatex(Temp,63, "\r%s\y Admin Menu^n Choose Time", TAG )
	menu = menu_create(Temp, "BanHandler");
	
	new key[20]
	for(new i=0; i < sizeof(BanName); i++) 
	{		
		num_to_str(i,key,sizeof(key)-1)
		menu_additem(menu, BanName[i], key);
	}
	menu_display(id, menu, 0);
}
public BanHandler(id, menu, key) {
	if( key == MENU_EXIT ) {
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	g_BanTime[id] = key

	client_cmd(id, "messagemode type_reason");
	
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public CmdReason(id) {
	if((get_user_flags( id ) & ADMIN_LEVEL ) )  
	{
		new zReason[50]
		read_argv(1,zReason,charsmax(zReason))
		copy(Reason[id],charsmax(zReason), zReason)
		
		get_user_name(id, Name2, charsmax(Name2))
		get_user_name(Name[id], Name3, charsmax(Name3))

		switch(Style[id])
		{
			case 0: SlayPlayer(id) 			// Slay
			case 1: KickPlayer(id) 			// Kick
			case 2: BanPlayer(id)  			// Ban
			case 3: WarnPlayer(id)			// Warning
			case 4: ChangeNickPlayer(id)		// Nick
			case 5: TransferPlayer(id)		// Transfer
		}
	}
}

public SlayPlayer(id) {	
	if(is_user_alive(Name[id])) 
	{
			user_kill(Name[id])
			ColorChat(0, GREY, "^4%s %s^3 slayed^4 %s^3 for ^4%s", TAG, Name2, Name3, Reason[id])
			
			new message[200], Time[64]
			get_time("%c", Time, charsmax(Time)) 
			format ( message, charsmax(message), "[%s] %s slayed %s for %s", Time, Name2, Name3, Reason[id])
			write_file ( "addons/amxmodx/logs/adminmenu.txt", message )
			
			return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is already dead", TAG, Name3)
	
	return PLUGIN_HANDLED;
}
public KickPlayer(id) {
	
	if(is_user_connected(Name[id])) 
	{	
		client_cmd(id, "amx_kick #%d ^"Kicked by %s. Reason: %s^"",get_user_userid(Name[id]), Name2, Reason[id])
		ColorChat(0, GREY, "^4%s %s^3 kicked^4 %s^3 for ^4%s", TAG, Name2, Name3, Reason[id])
		
		new message[200], Time[64]
		get_time("%c", Time, charsmax(Time)) 
		format ( message, charsmax(message), "[%s] %s kicked %s for %s", Time, Name2, Name3, Reason[id])
		write_file ( "addons/amxmodx/logs/adminmenu.txt", message )
		
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, Name3)

	return PLUGIN_HANDLED;
}
public BanPlayer(id) {
	
	if(is_user_connected(Name[id])) 
	{	
		client_cmd(id, "amx_ban %d #%d ^"%s^"", BanTime[g_BanTime[id]], get_user_userid(Name[id]), Reason[id])
		ColorChat(0, GREY, "^4%s %s^3 banned^4 %s^3 for ^4%s^3 (^4^%s^3)", TAG, Name2, Name3, Reason[id], BanName[g_BanTime[id]])
		
		new message[200], Time[64]
		get_time("%c", Time, charsmax(Time)) 
		format ( message, charsmax(message), "[%s] %s banned %s for %s (%s)", Time, Name2, Name3, Reason[id], BanName[g_BanTime[id]])
		
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, Name2)
	return PLUGIN_HANDLED;

}
public ChangeNickPlayer(id) {
	
	if(is_user_connected(Name[id])) 
	{	
		set_user_info(Name[id],"name",Reason[id]) 
		ColorChat(0, GREY, "^4%s %s^3 changed^4 %s^3 name to ^4%s", TAG, Name2, Name3, Reason[id])
		
		new message[200], Time[64]
		get_time("%c", Time, charsmax(Time)) 
		format ( message, charsmax(message), "[%s] %s changed %s name to %s", Time, Name2, Name3, Reason[id])
		
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, Name3)

	return PLUGIN_HANDLED;
}
public TransferPlayer(id) {
	
	if(is_user_alive(Name[id])) 
	{
			cs_set_user_team(Name[id], cs_get_user_team(Name[id]) == CS_TEAM_T ? CS_TEAM_CT : CS_TEAM_T);
			ExecuteHamB(Ham_CS_RoundRespawn, Name[id]);
			ColorChat(0, GREY, "^4%s %s^3 transfered^4 %s^3 to the other team. For ^4%s", TAG, Name2, Name3, Reason[id])
			
			new message[200], Time[64]
			get_time("%c", Time, charsmax(Time)) 
			format ( message, charsmax(message), "[%s] %s transfered %s to the other team. For %s", Time, Name2, Name3, Reason[id])
			
			return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is already dead", TAG, Name3)
	
	return PLUGIN_HANDLED;
}

public WarnPlayer(id) {
	
	new szAuthID[32]; get_user_authid(Name[id], szAuthID, charsmax(szAuthID));
	
	if(is_user_connected(Name[id])) 
	{
		g_iWarningsCount[Name[id]] += 1;
		ColorChat(0, GREY, "^4%s %s^3 gave^4 %s^3 a warning for ^4%s^3 Total Warnings:^4 %i", TAG, Name2, Name3, Reason[id], g_iWarningsCount[Name[id]])
		
		new message[200], Time[64]
		get_time("%c", Time, charsmax(Time)) 
		format ( message, charsmax(message), "[%s] %s gave %s a warning for %s Total Warnings: %i", Time, Name2, Name3, Reason[id], g_iWarningsCount[Name[id]])
		
		if(g_iWarningsCount[Name[id]] == 5) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 1 day^3 for having^4 5 warnings", TAG, Name3, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 1440 %s 5warnings", szAuthID)
			return PLUGIN_HANDLED;
		}
		else if(g_iWarningsCount[Name[id]] == 10) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 1 week^3 for having^4 10 warnings", TAG, Name3, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 10080 %s 10warnings", szAuthID)	
			return PLUGIN_HANDLED;
		}
		else if(g_iWarningsCount[Name[id]] == 20) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 1 month^3 for having^4 20 warnings", TAG, Name3, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 43200 %s 20warnings", szAuthID)				
			return PLUGIN_HANDLED;
		}
		else if(g_iWarningsCount[Name[id]] == 30) 
		{
			ColorChat(0, GREY, "^4%s %s^3 was banned^4 PERMANENT^3 for having^4 30 warnings", TAG, Name3, g_iWarningsCount[Name[id]])
			client_cmd(id, "amx_ban 0 %s 30warnings", szAuthID)				
			return PLUGIN_HANDLED;
		}
		return PLUGIN_HANDLED;
	}
	else ColorChat(id, GREY, "^4%s %s^3 is not connected", TAG, Name3)

	return PLUGIN_HANDLED;
}

public client_connect( id )
	load_warnings( id )

public client_disconnect( id )
	save_warnings( id )
		
stock save_warnings( index )
{
	gVault = nvault_open( "Warnings" )
	
	if( gVault == INVALID_HANDLE )
	{
		set_fail_state( "[Warnings] nValut ERROR: =-> Invalid-Handle" )
	}
	
	get_user_authid( index, gSteamID, charsmax( gSteamID ) )
	
	formatex( vKey, charsmax( vKey ), "%sWARNINGS", gSteamID )
	formatex( vData, charsmax( vData ), "%d", g_iWarningsCount[ index ] )
	nvault_set( gVault, vKey, vData )
	nvault_close( gVault )
}

stock load_warnings( index )
{
	gVault = nvault_open( "Warnings" )
	
	if( gVault == INVALID_HANDLE )
	{
		set_fail_state( "[Warnings] nValut ERROR: =-> Invalid-Handle" )
	}
	
	get_user_authid( index, gSteamID, charsmax( gSteamID ) )
	
	formatex( vKey, charsmax( vKey ), "%sWARNINGS", gSteamID )
	g_iWarningsCount[ index ] = nvault_get( gVault, vKey )
	nvault_close( gVault )
}
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode