PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Give Me Tag Dude"
#define VERSION "1.0"
#define AUTHOR "peNgueN"
enum {
TAG_SLOT,
TAG_ETKINLIK
}
new Type[ 33 ];
new const TAGLAR[2][] = {
"SLOT # ",
"ETKINLIK # "
}
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd( "say /tag", "cmdTag" );
}
public cmdTag( id )
{
if( get_user_flags( id ) & ADMIN_RCON )
{
new menu = menu_create( "\wTAG MENU", "showtagmenu_go" );
menu_additem( menu, "\wSlot Tagi Ver", "1" );
menu_additem( menu, "\wEtkinlik Tagi Ver", "2" );
menu_display( id, menu );
}
return PLUGIN_CONTINUE;
}
public showtagmenu_go( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new info[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, info, charsmax(info), szName, charsmax(szName), callback);
new key = str_to_num(info);
switch( key )
{
case 1:
{
Type[ id ] = TAG_SLOT;
showtagmenu2( id );
}
case 2:
{
Type[ id ] = TAG_ETKINLIK;
showtagmenu2( id );
}
}
menu_destroy( menu );
return PLUGIN_HANDLED;
}
public showtagmenu2( id )
{
if( get_user_flags( id ) & ADMIN_RCON )
{
new menu = menu_create( "\wCHOOSE", "showtagmenu2_go" );
menu_additem( menu, "\wHerkese Ver", "1" );
menu_additem( menu, "\wOyuncuya Ver", "2" );
menu_display( id, menu );
}
return PLUGIN_CONTINUE;
}
public showtagmenu2_go( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new info[6], szName[64];
new access, callback;
menu_item_getinfo(menu, item, access, info, charsmax(info), szName, charsmax(szName), callback);
new key = str_to_num(info);
switch( key )
{
case 1:
{
new players[ 32 ], pnum, szTag[ 32 ], szName[ 32 ];
get_players( players, pnum, "ch" );
switch( Type[ id ] )
{
case TAG_SLOT:
{
for( new i; i < pnum; i++ )
{
get_user_name( players[ i ], szName, charsmax( szName ) );
if( containi( szName, TAGLAR[ 1 ] ) != -1 )
{
replace_all( szName, charsmax( szName ), TAGLAR[ 1 ], "" );
}
format( szTag, charsmax( szTag ), "%s%s", TAGLAR[ 0 ], szName );
set_user_info( players[ i ], "name", szTag );
}
client_print( id, print_chat, "[TAG] Herkese Slot Tagi Verildi." );
}
case TAG_ETKINLIK:
{
for( new i; i < pnum; i++ )
{
get_user_name( players[ i ], szName, charsmax( szName ) );
if( containi( szName, TAGLAR[ 0 ] ) != -1 )
{
replace_all( szName, charsmax( szName ), TAGLAR[ 0 ], "" );
}
format( szTag, charsmax( szTag ), "%s%s", TAGLAR[ 1 ], szName );
set_user_info( players[ i ], "name", szTag );
}
client_print( id, print_chat, "[TAG] Herkese Etkinlik Tagi Verildi." );
}
}
}
case 2:
{
showplayersmenu( id );
}
}
menu_destroy( menu );
return PLUGIN_HANDLED;
}
public showplayersmenu( id )
{
new players[ 32 ], pnum;
new szName[ 32 ], Own[ 32 ];
get_players( players, pnum, "ch" );
new menu = menu_create( "\wCHOOSE PLAYER", "showplayersmenu_go" );
for( new i; i < pnum ; i++ )
{
get_user_name( players[ i ], szName, charsmax( szName ) );
num_to_str( players[ i ], Own, charsmax( Own ) );
menu_additem( menu, szName, Own );
}
menu_display( id, menu, 0 );
return PLUGIN_HANDLED;
}
public showplayersmenu_go( id, menu, item )
{
if( item == MENU_EXIT )
{
menu_destroy( menu );
return PLUGIN_HANDLED;
}
new info[6], Name[64];
new access, callback;
menu_item_getinfo(menu, item, access, info, charsmax(info), Name, charsmax(Name), callback);
new key = str_to_num(info);
new szName[ 32 ], szTag[ 32 ];
switch( Type[ id ] )
{
case TAG_SLOT:
{
get_user_name( key, szName, charsmax( szName ) );
if( containi( szName, TAGLAR[ 1 ] ) != -1 )
{
replace_all( szName, charsmax( szName ), TAGLAR[ 1 ], "" );
}
format( szTag, charsmax( szTag ), "%s%s", TAGLAR[ 0 ], szName );
client_print( id, print_chat, "[TAG] %s ' e Slot Tagi Verildi.", szName );
set_user_info( key, "name", szTag );
}
case TAG_ETKINLIK:
{
get_user_name( key, szName, charsmax( szName ) );
if( containi( szName, TAGLAR[ 0 ] ) != -1 )
{
replace_all( szName, charsmax( szName ), TAGLAR[ 0 ], "" );
}
format( szTag, charsmax( szTag ), "%s%s", TAGLAR[ 1 ], szName );
client_print( id, print_chat, "[TAG] %s ' e Etkinlik Tagi Verildi.", szName );
set_user_info( key, "name", szTag );
}
}
menu_destroy( menu );
return PLUGIN_HANDLED;
}
Amxx ekte.