Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < amxmisc >
- #include < fakemeta >
- #include < engine >
- #include < cstrike >
- #include < colorchat >
- #define MaxPlayers get_maxplayers()
- new Float: Origin[3];
- new Prefix[] = "AMXX";
- public plugin_init() {
- register_plugin( "Teleport", "1.0", "ISRaiyaN" )
- register_clcmd( "say", "Teleport" )
- }
- public Teleport( id )
- {
- new Cmd[ 192 ], szArgs[ 3 ][ 32 ];
- read_argv( 1, Cmd, charsmax( Cmd ) )
- parse( Cmd, szArgs[ 0 ], 33, szArgs[ 1 ], 32, szArgs[ 2 ], 32 )
- if( equali( szArgs[ 0 ], "!tp" ) )
- {
- if(!( get_user_flags(id) & ADMIN_LEVEL_C ))
- {
- ColorChat( id, RED, "^3[ ^1%s ^3] ^1You don't have ^3Access ^1to this ^4Command^1!", Prefix )
- return 1;
- }
- new player1 = cmd_target( id, szArgs[ 1 ], 32 )
- new player2 = cmd_target( id, szArgs[ 2 ], 32 )
- GetTP( player2 )
- if( equali( szArgs[ 1 ], "@t" ) )
- {
- for (new i=1; i <=MaxPlayers; i++)
- {
- if( is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T )
- TP( i )
- }
- ColorChat( 0, RED, "^3[ ^1%s ^3] ^1ADMIN: ^3%s ^1Has ^3^"^4Teleported^3^" ^4All Terrorists ^1To ^3%s", Prefix, GetName( id ), GetName( player2 ) )
- return 1;
- }
- if( equali( szArgs[ 1 ], "@ct" ) )
- {
- for (new i=1; i <=MaxPlayers; i++)
- {
- if( is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT )
- TP( i )
- }
- ColorChat( 0, RED, "^3[ ^1%s ^3] ^1ADMIN: ^3%s ^1Has ^3^"^4Teleported^3^" ^4All Counter-Terrorists ^1To ^3%s", Prefix, GetName( id ), GetName( player2 ) )
- return 1;
- }
- if( equali( szArgs[ 1 ], "@spec" ) )
- {
- for (new i=1; i <=MaxPlayers; i++)
- {
- if( is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR )
- TP( i )
- }
- ColorChat( 0, RED, "^3[ ^1%s ^3] ^1ADMIN: ^3%s ^1Has ^3^"^4Teleported^3^" ^4All Spectators ^1To ^3%s", Prefix, GetName( id ), GetName( player2 ) )
- return 1;
- }
- if( equali( szArgs[ 1 ], "@all" ) )
- {
- for (new i=1; i <=MaxPlayers; i++)
- {
- if( is_user_alive(i) )
- TP( i )
- }
- ColorChat( 0, RED, "^3[ ^1%s ^3] ^1ADMIN: ^3%s ^1Has ^3^"^4Teleported^3^" ^4All Players ^1To ^3%s", Prefix, GetName( id ), GetName( player2 ) )
- return 1;
- }
- else
- {
- if( !player1 )
- {
- ColorChat( id, RED, "^3[ ^1%s ^3] Error: ^1This player ( ^3%s ^1) was ^4Not Found^1 or There are more than^4 1 ^1player with that name.", Prefix, szArgs[ 1 ] )
- return 1;
- }
- if( !player2 )
- {
- ColorChat( id, RED, "^3[ ^1%s ^3] Error: ^1This player ( ^3%s ^1) was ^4Not Found^1 or There are more than^4 1 ^1player with that name.", Prefix, szArgs[ 2 ] )
- return 1;
- }
- if( !is_user_alive( player1 ) )
- {
- ColorChat( id, RED, "^3[ ^1%s ^3] Error: ^1This action could not perform on ^3^"^4Dead Client^3^"^1.", Prefix )
- return 1;
- }
- else
- {
- TP( player1 )
- ColorChat( 0, RED, "^3[ ^1%s ^3] ^1ADMIN: ^3%s ^1Has ^3^"^4Teleported^3^" ^3%s ^1To ^3%s", Prefix, GetName( id ), GetName( player1 ), GetName( player2 ) )
- return 1;
- }
- }
- }
- return 0;
- }
- stock TP( player )
- entity_set_origin( player, Origin );
- stock GetTP( player )
- entity_get_vector( player, EV_VEC_origin, Origin );
- stock GetName( player )
- {
- new szName[ 32 ];
- get_user_name( player, szName, charsmax( szName ) );
- return szName;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement