PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
new smartawp_enable
new bool:awpTry[ 33 ];
public plugin_init( ) {
register_plugin( "smartAwp", "1.0", "DarkD" )
smartawp_enable = register_cvar( "smartawp_enable", "1" )
register_clcmd( "say /awp", "smartAwp" );
register_event( "HLTV", "event_new_round", "a", "1=0", "2=0" )
}
public event_new_round( ) {
arrayset( awpTry, false, 32 );
}
public smartAwp( id ) {
if ( !is_user_alive( id ) ) return PLUGIN_HANDLED;
if( get_pcvar_num( smartawp_enable ) ) {
if( !awpTry[ id ] ) {
if( random_num( 0, 3 ) == 3 )
give_item( id, "weapon_awp" );
else
client_print( id, print_chat, "Sorry, no AWP for you this round." );
awpTry[ id ] = true;
} else
client_print( id, print_chat, "You already tryed to get a awp this round!" );
} else
client_print( id, print_chat, "This plugin is disabled." );
return PLUGIN_CONTINUE;
}
__________________