#include <amxmodx>
#include <engine>
#pragma semicolon 1
public plugin_init()
{
register_plugin( "Sniper Manager", "1.0", "Demon" );
register_cvar("Sniper Manager", "By Demon", FCVAR_SERVER);
}
public plugin_precache()
{
new scout_gravity = get_pcvar_num( register_cvar( "scout_gravity", "215" ) );
new sMapName[ 32 ], Entity;
get_mapname( sMapName, charsmax( sMapName ) );
Entity = create_entity( "info_map_parameters" );
DispatchKeyValue( Entity, "buying", "3" );
DispatchKeyValue( Entity, "bombradius", "500" );
DispatchSpawn( Entity );
Entity = create_entity( "player_weaponstrip" );
DispatchKeyValue( Entity, "targetname", "stripper" );
DispatchSpawn( Entity );
Entity = create_entity( "game_player_equip" );
DispatchKeyValue( Entity, "weapon_knife" , "1" );
if ( containi( sMapName, "awp" ) != -1 )
{
DispatchKeyValue( Entity, "weapon_awp", "1" );
DispatchKeyValue( Entity, "ammo_338magnum", "3" );
}
else if ( containi( sMapName, "scout" ) != -1 )
{
DispatchKeyValue( Entity, "weapon_scout", "1" );
DispatchKeyValue( Entity, "ammo_762nato", "9" );
if ( scout_gravity > 0 )
set_task( 2.0, "set_gravity", scout_gravity );
}
DispatchKeyValue( Entity, "targetname", "equipment" );
DispatchSpawn( Entity );
Entity = create_entity( "multi_manager" );
DispatchKeyValue( Entity, "equipment" , "1" );
DispatchKeyValue( Entity, "stripper" , "0" );
DispatchKeyValue( Entity, "targetname", "game_playerspawn" );
DispatchKeyValue( Entity, "spawnflags", "1" );
DispatchSpawn( Entity );
}
public set_gravity( gravity ) server_cmd( "sv_gravity %d", gravity );
public pfn_keyvalue( Entity )
{
new ClassName[ 20 ], KeyName[ 16 ], Value[ 20 ];
copy_keyvalue( ClassName, charsmax( ClassName ), KeyName, charsmax( KeyName ), Value, charsmax( Value ) );
if ( equal( ClassName, "info_map_parameters" ) || equal( ClassName, "func_buyzone" )
|| equal( ClassName, "game_player_equip" ) || equal( ClassName, "player_weaponstrip" ))
{
remove_entity( Entity );
return PLUGIN_HANDLED;
}
else if ( equal( ClassName, "multi_manager" ) && equal( KeyName, "targetname" ) && equal( Value, "game_playerspawn" ) )
{
remove_entity( Entity );
return PLUGIN_HANDLED;
}
else if ( equal( ClassName, "armoury_entity" ) )
{
remove_entity( Entity );
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/