HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /*
  2.   Fordította: BBk - Death of Legend
  3. */
  4. #include <amxmodx>
  5. #include <cstrike>
  6. #include <hamsandwich>
  7.  
  8. new gCvarArmor;
  9. new gCvarAmount;
  10.  
  11. public plugin_init() {
  12. register_plugin( "Spawn with Armor", "1.0", "xPaw" );
  13.  
  14. gCvarArmor = register_cvar( "sv_armor", "2" );
  15. gCvarAmount = register_cvar( "sv_armor_amount", "100" );
  16.  
  17. RegisterHam( Ham_Spawn, "player", "fwdPlayerSpawn", 1 );
  18. }
  19.  
  20. public fwdPlayerSpawn( id ) {
  21. if( is_user_alive( id ) ) {
  22. new iPluginArmorType = clamp( get_pcvar_num( gCvarArmor ), 0, 2 );
  23.  
  24. if( iPluginArmorType > 0 ) {
  25. new CsArmorType:iPlayerArmorType;
  26. new iPlayerAmount = cs_get_user_armor( id, iPlayerArmorType );
  27. new iPluginAmount = min( get_pcvar_num( gCvarAmount ), 0xFF );
  28.  
  29. cs_set_user_armor( id, max( iPluginAmount, iPlayerAmount ), CsArmorType:max( iPluginArmorType, _:iPlayerArmorType ) );
  30. }
  31. }
  32. }