hello guys , i wanted to make a plugin that transfers terrorist to Ct when he says /swapme, and to work for Te team only,after that to choose a random player from Ct to replace him xD
this is the best i could..
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
new const g_szPrefix[ ] = "[Deathrun]";
public plugin_init( ) {
register_plugin( "terrorist swap", "0.1", "unknown" );
register_clcmd( "say /swapme", "Randromize" );
}
public Randromize( id ) {
if( cs_get_user_team( id ) != CS_TEAM_T ) {
client_print( id, print_chat, "%s This command is only for terrorists!", g_szPrefix );
return PLUGIN_CONTINUE;
}
if( cs_get_user_team( id ) != CS_TEAM_CT ) {
cs_set_user_team( id , CS_TEAM_CT )
spawn( id )
client_print( id, print_chat, "%s u have been successfully swaped To Ct", g_szPrefix );
return PLUGIN_CONTINUE;
}
new iRandomPlayer;
if( cs_get_user_team( iRandomPlayer ) != CS_TEAM_T ) {
cs_set_user_team(iRandomPlayer, CS_TEAM_T);
new szName[ 32 ];
get_user_name( iRandomPlayer, szName, 31 );
client_print(0, print_chat, "%s %s is now new terrorist", g_szPrefix, szName);
}
return PLUGIN_CONTINUE;
}
__________________