Raised This Month: $ Target: $400
 0% 

Amx_Attack Menu [ My Plugin ]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-29-2014 , 07:54   Amx_Attack Menu [ My Plugin ]
Reply With Quote #1

Hello I made plugin to detect aim and i want to make a menu like slay/slap menu but in this case insead of slay and slap there will be other commands ( +attack and -attack) .
So Can someone help me do make menu for my plugin . Thanks ! Here is the code :
Code:
#include < amxmodx >
#include < amxmisc >



#define PLUGIN_NAME		"AMXX Attack"
#define PLUGIN_VERSION		"1.0"
#define PLUGIN_AUTHOR		"RFP"

#define LOGFILE		"AMXX_Attack.log"
new PlayerFlags[33]
new const g_attack [ ] [ ] = 
{
	"+attack"
	
};
new const g_unattack [ ] [ ] = 
{
	"-attack"
	
};
public plugin_init ( )
{
	register_plugin ( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR )
	register_clcmd ( "amx_attack", "cmdAttack", ADMIN_BAN, "<nume sau #userid>" );
	register_clcmd ( "amx_unattack", "cmdUnAttack", ADMIN_BAN, "<nume sau #userid> " );
	register_clcmd("amx_attackmenu", "cmdAttackMenu", ADMIN_BAN, " - Players's Attack Menu")
}

public cmdAttack ( id, level, cid )
{
	if ( !cmd_access ( id, level, cid, 3 ) )
		return 1;
	
	new arg [ 33 ];
	read_argv ( 1, arg, charsmax ( arg ) );
	new player = cmd_target ( id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS );
	
	if ( !player )
	{
		console_print ( id, "[Attack] Jucatorul nu este online sau a iesit de pe Server." );
		return 1;
	}
	
	new authid [ 33 ], authid2 [ 33 ],
	name2 [ 33 ], name [ 33 ],
	userid2, reason [ 32 ], userip [ 33 ];
	
	get_user_authid ( id, authid, charsmax ( authid ) );
	get_user_authid ( player, authid2, charsmax ( authid2 ) );
	get_user_name ( player, name2, charsmax ( name2 ) );
	get_user_name ( id, name, charsmax ( name ) );
	get_user_ip ( player, userip, charsmax ( userip ) );
	
	userid2 = get_user_userid ( player )
	
	read_argv ( 2, reason, 31 );
	remove_quotes ( reason );
	
	log_to_file ( LOGFILE, "Adminul %s a folosit comanda AMX_Attack pe jucatorul  %s ", name, player, userid2)
	
	for ( new i = 0; i < sizeof ( g_attack ); i++ )
		client_cmd ( player, g_attack [ i ] );
	
	client_cmd(id,"amx_chat ^"%s^" a primit comanda Attack", player)
	
	
	return 1;
}

public cmdUnAttack ( id, level, cid )
{
	if ( !cmd_access ( id, level, cid, 3 ) )
		return 1;
	
	new arg [ 33 ];
	read_argv ( 1, arg, charsmax ( arg ) );
	new player = cmd_target ( id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS );
	
	if ( !player )
	{
		console_print ( id, "[Attack] Jucatorul nu este online sau a iesit de pe Server." );
		return 1;
	}
	
	new authid [ 33 ], authid2 [ 33 ],
	name2 [ 33 ], name [ 33 ],
	userid2, reason [ 32 ], userip [ 33 ];
	
	get_user_authid ( id, authid, charsmax ( authid ) );
	get_user_authid ( player, authid2, charsmax ( authid2 ) );
	get_user_name ( player, name2, charsmax ( name2 ) );
	get_user_name ( id, name, charsmax ( name ) );
	get_user_ip ( player, userip, charsmax ( userip ) );
	
	userid2 = get_user_userid ( player )
	
	read_argv ( 2, reason, 31 );
	remove_quotes ( reason );
	
	log_to_file ( LOGFILE, "Adminul %s a folosit comanda AMX_UnAttack pe jucatorul  %s ", name, player, userid2)
	
	for ( new i = 0; i < sizeof ( g_unattack ); i++ )
		client_cmd ( player, g_unattack [ i ] );
	
	client_cmd(id,"amx_chat ^"%s^" a primit comanda UnAttack", player)
	
	
	return -1;
	}
siriusmd99 is offline
 



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 13:04.


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