This is code from xPaw's "DeathRun FreeRound Vote"
If player(TS) say /free, will be Free Round without vote.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include < amxmodx >
#include < cstrike >
#include < fakemeta >
#include < hamsandwich >
#include < colorchat >
const m_toggle_state = 41;
new bool:g_bFreeRound;
new g_synced;
public plugin_init() {
register_plugin( "Free Round without Vote", "1.0", "xPaw" );
register_clcmd( "say /free", "CmdFreeRound" );
register_clcmd( "say /freeround", "CmdFreeRound" );
RegisterHam( Ham_Use, "func_rot_button", "FwdHamUse_Button" );
RegisterHam( Ham_Use, "func_button", "FwdHamUse_Button" );
RegisterHam( Ham_Use, "button_target", "FwdHamUse_Button" );
register_event( "CurWeapon", "EventCurWeapon", "be", "1=1", "2!29" );
register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );
register_event( "TextMsg", "EventRestart", "a", "2&#Game_C", "2&#Game_w" );
g_synced = CreateHudSyncObj( );
}
public EventNewRound( ) {
if( g_bFreeRound ) {
g_bFreeRound = false;
return;
}
}
public EventRestart( ) {
g_bFreeRound = false;
}
public EventCurWeapon( id ) {
if( g_bFreeRound ) {
engclient_cmd( id, "weapon_knife" );
}
}
public CmdFreeRound( id ) {
if( cs_get_user_team( id ) != CS_TEAM_T ) {
ColorChat( id, RED, "^4[Deathrun]^3 This command is only for terrorists!");
return PLUGIN_CONTINUE;
}
else if( g_bFreeRound ) {
ColorChat( id, RED, "^4[Deathrun]^3 It is Free Round already!");
return PLUGIN_CONTINUE;
}
new szName[ 32 ];
get_user_name( id, szName, charsmax( szName ) )
set_hudmessage( 255, 255, 155, -1.0, 0.15, 1, 0.5, 1.0, 0.5, 15.0, -1)
ShowSyncHudMsg( 0, g_synced, "- Free Round -^nNo Traps, No Weapons" );
ColorChat( 0, RED, "^4[Deathrun]^3 Free round started by^4 %s", szName );
g_bFreeRound = true;
return PLUGIN_CONTINUE;
}
public FwdHamUse_Button( iEntity, id, iActivator, iUseType, Float:flValue ) {
if( g_bFreeRound && iUseType == 2 && flValue == 1.0 && is_user_alive( id )
&& get_user_team( id ) == 1 && get_pdata_int( iEntity, m_toggle_state, 4 ) == 1 ) {
ColorChat( id, RED, "^4[Deathrun]^3 Free Round = No traps, No Weapons." );
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}