#include <amxmodx>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fun>
#include <engine>
#include <fakemeta>
#define PLUGIN "Only_Sniper_and_DEagle"
#define VERSION "0.5"
#define AUTHOR "Covek"
/*
** Cvars:
*** amx_give_priweapon
**** 0 - AWP - Default
**** 1 - Scout
**
*** amx_give_priammo
**** 0
**** 1
**** 2
**** 3 - Default
**
*** amx_give_secammo
**** 0
**** 1
**** 2
**** 3
**** 4
**** 5 - Default
**
** A vásárlás blokkolót Arkshine-tõl zabráltam.
** A fegyvereket a földrõl eltüntetõs részt Exolent-tõl zabráltam.
*/
new g_iSpawnForward;
new const weapon[][] = {
"weapon_awp",
"weapon_scout"
}
new maxammo[][] = {
"3",
"3",
"5"
}
new const ammotype[][] = {
"ammo_338magnum",
"ammo_762nato"
}
public plugin_precache( )
{
new Entity = create_entity( "info_map_parameters" );
DispatchKeyValue( Entity, "buying", "3" );
DispatchKeyValue(Entity, "bombradius", "500");
DispatchSpawn( Entity );
g_iSpawnForward = register_forward( FM_Spawn, "FwdSpawn" );
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar("amx_give_priweapon", "0");
register_cvar("amx_give_priammo", maxammo[get_cvar_num("amx_give_priweapon")]);
register_cvar("amx_give_secammo", maxammo[2]) ;
RegisterHam( Ham_Spawn, "player", "fwdPlayerSpawn", 1 );
unregister_forward( FM_Spawn, g_iSpawnForward );
set_cvar_num("sv_restartround", 1);
}
public fwdPlayerSpawn( id)
{
if((get_cvar_num("amx_give_priweapon") != 0) && (get_cvar_num("amx_give_priweapon") != 1) )
{
set_cvar_num("amx_give_priweapon",0);
}
if( is_user_alive( id ) )
{
strip_user_weapons(id)
give_item(id,"weapon_knife")
if((get_cvar_num("amx_give_priweapon") == 0) || (get_cvar_num("amx_give_priweapon") == 1) )
{
give_item(id,weapon[get_cvar_num("amx_give_priweapon")]);
for(new i = 0; get_cvar_num("amx_give_priammo") > i; i++)
{
give_item(id,ammotype[get_cvar_num("amx_give_priweapon")]);
}
}
give_item(id,"weapon_deagle");
for(new i = 0; get_cvar_num("amx_give_secammo") > i; i++)
{
give_item(id,"ammo_50ae");
}
give_item(id, "item_assaultsuit");
if( cs_get_user_team( id ) == CS_TEAM_CT && !cs_get_user_defuse( id ) )
{
give_item(id, "item_thighpack");
}
}
}
public pfn_keyvalue( Entity )
{
new ClassName[ 20 ], Dummy[ 2 ];
copy_keyvalue( ClassName, charsmax( ClassName ), Dummy, charsmax( Dummy ), Dummy, charsmax( Dummy ) );
if( equal( ClassName, "info_map_parameters" ) )
{
remove_entity( Entity );
return PLUGIN_HANDLED ;
}
return PLUGIN_CONTINUE;
}
public FwdSpawn( iEntity )
{
if( pev_valid( iEntity ) )
{
static szClassname[ 32 ];
pev( iEntity, pev_classname, szClassname, 31 );
static const armoury_entity[ ] = "armoury_entity";
if( equal( szClassname, armoury_entity ) )
{
engfunc( EngFunc_RemoveEntity, iEntity );
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
*/