Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include < amxmodx >
- #include < amxmisc >
- #include < fun >
- #define ADMIN_FLAG ADMIN_BAN
- public plugin_init()
- {
- register_plugin( "Admin Stack( AMXX )", "1.0", "Xdoctor" );
- register_clcmd( "say", "CmdHandleSay" );
- register_clcmd( "say_team", "CmdHandleSay" );
- }
- public CmdHandleSay( client )
- {
- new szMsg[ 60 ], szArgs[ 2 ][ 40 ], iPlayer;
- read_argv( 1, szMsg, charsmax( szMsg ) );
- parse( szMsg, szArgs[ 0 ], charsmax( szArgs[] ), szArgs[ 1 ], charsmax( szArgs[] ) );
- if( equali( szArgs[ 0 ], "/stack" ) )
- {
- if( !get_user_flags( client ) && ADMIN_FLAG )
- return ColorChat( client, "^1 this command can be used only by an admin^3." );
- iPlayer = cmd_target( client, szArgs[ 1 ], 8 );
- if( !iPlayer )
- return ColorChat( client, "Target wasn't found !" );
- new ClientOrigin[ 3 ];
- get_user_origin( client, ClientOrigin, 1 );
- if( !contain( szArgs[ 0 ], "@all" ) )
- {
- ColorChat( client, "^4%s^1 You have ^3successfuly transfer ^4%s ^3to you !", GetUserName( client ), GetUserName( iPlayer ) );
- set_user_origin( iPlayer, ClientOrigin );
- }
- else
- if( contain( szArgs[ 0 ], "@all" ) )
- {
- set_user_origin( 0, ClientOrigin );
- ColorChat( client, "^4%s^1 You have ^3successfuly transfer every one to you !", GetUserName( client ) );
- }
- }
- return 0;
- }
- stock GetUserName( const Index )
- {
- static szName[ 32 ];
- get_user_name( Index, szName, charsmax( szName ) );
- return szName;
- }
- stock ColorChat(const id, const string[], {Float, Sql, Resul,_}:...)
- {
- new msg[191], players[32], count = 1
- static len
- len = formatex(msg, charsmax(msg), "^1[ ^4AMXX ^1] " )
- vformat(msg[len], charsmax(msg) - len, string, 3)
- if(id) players[0] = id
- else get_players(players,count,"ch")
- for (new i = 0; i < count; i++)
- {
- if(is_user_connected(players[i]))
- {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"),_, players[i])
- write_byte(players[i])
- write_string(msg)
- message_end()
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement