HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #pragma semicolon 1
  2. #include < sourcemod >
  3.  
  4. #define PLUGIN_VERSION "0.1.0b"
  5. #define CVAR_FLAGS (FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY)
  6.  
  7. new Handle:cvar_armor = INVALID_HANDLE;
  8. new Handle:cvar_armor_amount = INVALID_HANDLE;
  9.  
  10. new String:g_armor_prop[ ] = { "m_ArmorValue" };
  11.  
  12. public Plugin:myinfo =
  13. {
  14. name = "Kezdesnel Armor",
  15. author = "fezh",
  16. description = "Kezdesnel Kapsz Ingyen Armort",
  17. version = PLUGIN_VERSION,
  18. url = "http://www.sourcemod.net"
  19. }
  20.  
  21. public OnPluginStart()
  22. {
  23. cvar_armor = CreateConVar( "sv_armor", "1", "Be/Ki kapcsolni a plugint" );
  24. cvar_armor_amount = CreateConVar( "sv_armor_amount", "100", "Mennyi pancelt kapjon kezdesnel a jatekos" );
  25.  
  26. HookEvent( "player_spawn", HookPlayerSpawn, EventHookMode_Post );
  27.  
  28. CreateConVar( "sm_spawn_armor", PLUGIN_VERSION, "Kezdesnel Armor", CVAR_FLAGS );
  29. }
  30.  
  31. public HookPlayerSpawn( Handle:event, const String:name[ ], bool:dontBroadcast )
  32. {
  33. new client = GetClientOfUserId( GetEventInt( event, "userid" ) );
  34.  
  35. if ( IsPlayerAlive( client ) && GetConVarInt( cvar_armor ) )
  36. {
  37. SetEntProp( client, Prop_Send, g_armor_prop, GetConVarInt( cvar_armor_amount ), 1 );
  38. }
  39. }
  40.