HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <hamsandwich>
  3. #include <fun>
  4. #include <cstrike>
  5. #include <fun>
  6. #include <engine>
  7. #include <fakemeta>
  8.  
  9.  
  10. #define PLUGIN "Only_Sniper_and_DEagle"
  11. #define VERSION "0.5"
  12. #define AUTHOR "Covek"
  13.  
  14. /*
  15. ** Cvars:
  16. *** amx_give_priweapon
  17. **** 0 - AWP - Default
  18. **** 1 - Scout
  19. **
  20. *** amx_give_priammo
  21. **** 0
  22. **** 1
  23. **** 2
  24. **** 3 - Default
  25. **
  26. *** amx_give_secammo
  27. **** 0
  28. **** 1
  29. **** 2
  30. **** 3
  31. **** 4
  32. **** 5 - Default
  33. **
  34. ** A vásárlás blokkolót Arkshine-tõl zabráltam.
  35. ** A fegyvereket a földrõl eltüntetõs részt Exolent-tõl zabráltam.
  36. */
  37.  
  38. new g_iSpawnForward;
  39.  
  40. new const weapon[][] = {
  41. "weapon_awp",
  42. "weapon_scout"
  43. }
  44. new maxammo[][] = {
  45. "3",
  46. "3",
  47. "5"
  48. }
  49. new const ammotype[][] = {
  50. "ammo_338magnum",
  51. "ammo_762nato"
  52. }
  53.  
  54. public plugin_precache( )
  55. {
  56. new Entity = create_entity( "info_map_parameters" );
  57. DispatchKeyValue( Entity, "buying", "3" );
  58. DispatchKeyValue(Entity, "bombradius", "500");
  59. DispatchSpawn( Entity );
  60.  
  61. g_iSpawnForward = register_forward( FM_Spawn, "FwdSpawn" );
  62. }
  63.  
  64. public plugin_init()
  65. {
  66. register_plugin(PLUGIN, VERSION, AUTHOR);
  67.  
  68. register_cvar("amx_give_priweapon", "0");
  69. register_cvar("amx_give_priammo", maxammo[get_cvar_num("amx_give_priweapon")]);
  70. register_cvar("amx_give_secammo", maxammo[2]) ;
  71.  
  72. RegisterHam( Ham_Spawn, "player", "fwdPlayerSpawn", 1 );
  73. unregister_forward( FM_Spawn, g_iSpawnForward );
  74. set_cvar_num("sv_restartround", 1);
  75. }
  76.  
  77. public fwdPlayerSpawn( id)
  78. {
  79. if((get_cvar_num("amx_give_priweapon") != 0) && (get_cvar_num("amx_give_priweapon") != 1) )
  80. {
  81. set_cvar_num("amx_give_priweapon",0);
  82. }
  83. if( is_user_alive( id ) )
  84. {
  85. strip_user_weapons(id)
  86.  
  87. give_item(id,"weapon_knife")
  88.  
  89. if((get_cvar_num("amx_give_priweapon") == 0) || (get_cvar_num("amx_give_priweapon") == 1) )
  90. {
  91. give_item(id,weapon[get_cvar_num("amx_give_priweapon")]);
  92. for(new i = 0; get_cvar_num("amx_give_priammo") > i; i++)
  93. {
  94. give_item(id,ammotype[get_cvar_num("amx_give_priweapon")]);
  95. }
  96. }
  97. give_item(id,"weapon_deagle");
  98. for(new i = 0; get_cvar_num("amx_give_secammo") > i; i++)
  99. {
  100. give_item(id,"ammo_50ae");
  101. }
  102.  
  103. give_item(id, "item_assaultsuit");
  104.  
  105. if( cs_get_user_team( id ) == CS_TEAM_CT && !cs_get_user_defuse( id ) )
  106. {
  107. give_item(id, "item_thighpack");
  108. }
  109. }
  110. }
  111.  
  112. public pfn_keyvalue( Entity )
  113. {
  114. new ClassName[ 20 ], Dummy[ 2 ];
  115. copy_keyvalue( ClassName, charsmax( ClassName ), Dummy, charsmax( Dummy ), Dummy, charsmax( Dummy ) );
  116.  
  117. if( equal( ClassName, "info_map_parameters" ) )
  118. {
  119. remove_entity( Entity );
  120. return PLUGIN_HANDLED ;
  121. }
  122. return PLUGIN_CONTINUE;
  123. }
  124.  
  125. public FwdSpawn( iEntity )
  126. {
  127. if( pev_valid( iEntity ) )
  128. {
  129. static szClassname[ 32 ];
  130. pev( iEntity, pev_classname, szClassname, 31 );
  131.  
  132. static const armoury_entity[ ] = "armoury_entity";
  133. if( equal( szClassname, armoury_entity ) )
  134. {
  135. engfunc( EngFunc_RemoveEntity, iEntity );
  136. return FMRES_SUPERCEDE;
  137. }
  138. }
  139. return FMRES_IGNORED;
  140. }
  141. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  142. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1038\\ f0\\ fs16 \n\\ par }
  143. */
  144.