#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "plugin_comenzi"
#define VERSION "1.0"
#define AUTHOR "Rusu" //update CoD2.0
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /spec","spec");
register_clcmd("say_team /spec","spec");
register_clcmd("say /ct","ct");
register_clcmd("say_team /ct","ct");
register_clcmd("say /t","t")
register_clcmd("say_team /t","t")
register_concmd ( "amx_t", "swap_team", ADMIN_KICK, "<name> - mutare jucator la Teroristi" );
register_concmd ( "amx_ct", "swap_team", ADMIN_KICK, "<name> - mutare jucator la Counter-Teroristi" );
register_concmd ( "amx_spec", "swap_team", ADMIN_KICK, "<name> - mutare jucator la Spectatori" );
set_task( 100.0, "mesaj", 0, "", 0, "b" );
}
public spec(id)
{
cs_set_user_team(id,CS_TEAM_SPECTATOR);
if(is_user_alive(id))
user_silentkill(id);
return PLUGIN_CONTINUE;
}
public ct(id)
{
cs_set_user_team(id,CS_TEAM_CT);
user_silentkill(id);
return PLUGIN_CONTINUE;
}
public t(id)
{
cs_set_user_team(id,CS_TEAM_T);
user_silentkill(id);
return PLUGIN_CONTINUE;
}
public mesaj()
{
client_print(0, print_chat, "Tasteaza in chat /comenzi pentr a vedea o lista cu comenzile tale !");
}
public comenzi(id)
{
console_print( id, "---- Comenzi disponibile pe server ----" );
console_print( id, "---------------------------------------" );
console_print( id, "/spec - pe say & say_team si te transferi la spectatori" );
console_print( id, "/ct - pe say & say_team si te transferi la CT" );
console_print( id, "/t - pe say & say_team si te transferi la tero" );
client_cmd( id, "toggleconsole" );
return PLUGIN_HANDLED;
}
public swap_team ( id, level, cid ) {
if( ! cmd_access ( id, level, cid, 2 ) )
return PLUGIN_HANDLED;
new szArg[ 10 ], target[ 32 ], szPlayerName[ 32 ], szAdminName[ 32 ];
read_argv( 0, szArg, 9 );
read_argv( 1, target, 31 );
new player = cmd_target ( id, target, 11 );
if( ! player )
return PLUGIN_HANDLED;
get_user_name ( player, szPlayerName, 31 );
get_user_name ( id, szAdminName, 31 );
switch ( szArg[ 4 ] ) {
case 't':
{
user_silentkill ( player );
cs_set_user_team ( player, 1 );
show_activity ( id, szAdminName, "mutare %s la Teroristi.", szPlayerName );
}
case 'c':
{
user_silentkill ( player );
cs_set_user_team ( player, 2 );
show_activity ( id, szAdminName, "mutare %s la Counter-Teroristi.", szPlayerName );
}
case 's':
{
user_silentkill ( player );
cs_set_user_team ( player, 3 );
show_activity ( id, szAdminName, "mutare %s la Spectatori.", szPlayerName );
}
}
return PLUGIN_CONTINUE;
}