HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <amxmodx>
  2. #include <engine>
  3.  
  4. #pragma semicolon 1
  5.  
  6. public plugin_init()
  7. {
  8. register_plugin( "Sniper Manager", "1.0", "Demon" );
  9. register_cvar("Sniper Manager", "By Demon", FCVAR_SERVER);
  10. }
  11.  
  12. public plugin_precache()
  13. {
  14. new scout_gravity = get_pcvar_num( register_cvar( "scout_gravity", "215" ) );
  15. new sMapName[ 32 ], Entity;
  16.  
  17. get_mapname( sMapName, charsmax( sMapName ) );
  18.  
  19. Entity = create_entity( "info_map_parameters" );
  20. DispatchKeyValue( Entity, "buying", "3" );
  21. DispatchKeyValue( Entity, "bombradius", "500" );
  22. DispatchSpawn( Entity );
  23.  
  24. Entity = create_entity( "player_weaponstrip" );
  25. DispatchKeyValue( Entity, "targetname", "stripper" );
  26. DispatchSpawn( Entity );
  27.  
  28. Entity = create_entity( "game_player_equip" );
  29. DispatchKeyValue( Entity, "weapon_knife" , "1" );
  30.  
  31. if ( containi( sMapName, "awp" ) != -1 )
  32. {
  33. DispatchKeyValue( Entity, "weapon_awp", "1" );
  34. DispatchKeyValue( Entity, "ammo_338magnum", "3" );
  35. }
  36. else if ( containi( sMapName, "scout" ) != -1 )
  37. {
  38. DispatchKeyValue( Entity, "weapon_scout", "1" );
  39. DispatchKeyValue( Entity, "ammo_762nato", "9" );
  40.  
  41. if ( scout_gravity > 0 )
  42. set_task( 2.0, "set_gravity", scout_gravity );
  43. }
  44.  
  45. DispatchKeyValue( Entity, "targetname", "equipment" );
  46. DispatchSpawn( Entity );
  47.  
  48. Entity = create_entity( "multi_manager" );
  49. DispatchKeyValue( Entity, "equipment" , "1" );
  50. DispatchKeyValue( Entity, "stripper" , "0" );
  51. DispatchKeyValue( Entity, "targetname", "game_playerspawn" );
  52. DispatchKeyValue( Entity, "spawnflags", "1" );
  53. DispatchSpawn( Entity );
  54. }
  55.  
  56. public set_gravity( gravity ) server_cmd( "sv_gravity %d", gravity );
  57.  
  58. public pfn_keyvalue( Entity )
  59. {
  60. new ClassName[ 20 ], KeyName[ 16 ], Value[ 20 ];
  61.  
  62. copy_keyvalue( ClassName, charsmax( ClassName ), KeyName, charsmax( KeyName ), Value, charsmax( Value ) );
  63.  
  64. if ( equal( ClassName, "info_map_parameters" ) || equal( ClassName, "func_buyzone" )
  65. || equal( ClassName, "game_player_equip" ) || equal( ClassName, "player_weaponstrip" ))
  66. {
  67. remove_entity( Entity );
  68. return PLUGIN_HANDLED;
  69. }
  70. else if ( equal( ClassName, "multi_manager" ) && equal( KeyName, "targetname" ) && equal( Value, "game_playerspawn" ) )
  71. {
  72. remove_entity( Entity );
  73. return PLUGIN_HANDLED;
  74. }
  75. else if ( equal( ClassName, "armoury_entity" ) )
  76. {
  77. remove_entity( Entity );
  78. return PLUGIN_HANDLED;
  79. }
  80.  
  81. return PLUGIN_CONTINUE;
  82. }
  83. /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
  84. *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
  85. */
  86.