For the third request try this out.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <engine>
#include <hamsandwich>
new const gszPrefix[] = "[CTR]"
new gCvarDeathMsg
new gCvarAnnouncement
new gCvarNextUse
new Float:gLastSwitch[33];
public plugin_init()
{
register_plugin( "ChooseteamReplacement", "1.0", "Rtk.Esc")
register_clcmd( "chooseteam", "replace_function" )
gCvarAnnouncement = register_cvar( "spec_announcement", "1" )
gCvarDeathMsg = register_cvar( "spec_deathmessage", "0" )
gCvarNextUse = register_cvar( "spec_nextuse", "15.0" )
}
public replace_function(id)
{
static Name[34]
get_user_name( id, Name, charsmax(Name) )
new iAnnounce = get_pcvar_num( gCvarAnnouncement )
new Float:flTime = halflife_time();
if ( flTime < gLastSwitch[id] + get_pcvar_float(gCvarNextUse) )
return PLUGIN_CONTINUE;
if ( cs_get_user_team(id) != CS_TEAM_CT )
{
cs_set_user_team( id, CS_TEAM_CT )
ExecuteHamB( Ham_CS_RoundRespawn, id )
if ( iAnnounce )
client_print( 0, print_chat, "%s%s respawned as Ct again", gszPrefix, Name )
}
else
{
cs_set_user_team( id, CS_TEAM_SPECTATOR )
if ( get_pcvar_num( gCvarDeathMsg ) )
user_kill(id, 1)
else
{
user_silentkill(id)
}
if ( iAnnounce )
client_print( 0, print_chat, "%s%s switched team to spectator", gszPrefix, Name )
}
gLastSwitch[id] = flTime;
return PLUGIN_HANDLED;
}
Removing dead bodies and weapons I'm not quite sure how to do only when this happends.
But since you have a lj server I see no need in keeping any bodies at all ( if that's okay ) you can use this.
PHP Code:
#include <amxmodx>
public plugin_init()
{
register_plugin( "no dead bodies" , "1.0" , "kp_uparrow" )
set_msg_block( get_user_msgid( "ClCorpse" ) , BLOCK_SET )
}
And same for weapons ( If you want them all to remove as soon as you drop them ) you can use this.
Remove Drop