HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. #define PLUGIN_AUTHOR "tuty"
  5. #define PLUGIN_VERSION "1.1"
  6. #pragma semicolon 1
  7.  
  8. new Handle:gPluginEnabled = INVALID_HANDLE;
  9.  
  10. public Plugin:myinfo =
  11. {
  12. name = "Resetscore",
  13. author = PLUGIN_AUTHOR,
  14. description = "Lenullazza a jatekost statjat.",
  15. version = PLUGIN_VERSION,
  16. url = "www.ligs.us"
  17. };
  18. public OnPluginStart()
  19. {
  20. RegConsoleCmd( "say", CommandSay );
  21. RegConsoleCmd( "say_team", CommandSay );
  22.  
  23. gPluginEnabled = CreateConVar( "sm_resetscore", "1" );
  24. CreateConVar( "resetscore_version", PLUGIN_VERSION, "Reset Score", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
  25. }
  26. public Action:CommandSay( id, args )
  27. {
  28. decl String:Said[ 128 ];
  29. GetCmdArgString( Said, sizeof( Said ) - 1 );
  30. StripQuotes( Said );
  31. TrimString( Said );
  32.  
  33. if( StrEqual( Said, "!resetscore" ) || StrEqual( Said, "!restartscore" ) )
  34. {
  35. if( GetConVarInt( gPluginEnabled ) == 0 )
  36. {
  37. PrintToChat( id, "\x03[Resetscore] A Plugin Kikapcsolva." );
  38. PrintToConsole( id, "[Resetscore] Nem hasznalhatja ezt a parancsot ha a plugin ki van kapcsolva." );
  39.  
  40. return Plugin_Continue;
  41. }
  42.  
  43. if( !IsPlayerAlive( id ) )
  44. {
  45. PrintToChat( id, "\x03[Resetscore] Nem lehet hasznalni ezt a parancsot, amig meghalt." );
  46. PrintToConsole( id, "[Resetscore] Csak elo jatekosok hasznalhatjak ezt a parancsot." );
  47.  
  48. return Plugin_Continue;
  49. }
  50.  
  51. if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
  52. {
  53. PrintToChat( id, "\x03[Resetscore] A Statod mar 0!" );
  54. PrintToConsole( id, "[Resetscore] Nem lehet visszaallitani a pontszamot." );
  55.  
  56. return Plugin_Continue;
  57. }
  58.  
  59. SetClientFrags( id, 0 );
  60. SetClientDeaths( id, 0 );
  61.  
  62. decl String:Name[ 32 ];
  63. GetClientName( id, Name, sizeof( Name ) - 1 );
  64.  
  65. PrintToChat( id, "\x03[Resetscore] Sikeresen nullaztad a statisztikadat!" );
  66. PrintToChatAll( "\x03[Resetscore] %s Nullazta a Statisztikajat!", Name );
  67. PrintToConsole( id, "[Resetscore] Sikeresen nullaztad a statisztikadat!" );
  68. }
  69.  
  70. return Plugin_Continue;
  71. }
  72. stock SetClientFrags( index, frags )
  73. {
  74. SetEntProp( index, Prop_Data, "m_iFrags", frags );
  75. return 1;
  76. }
  77. stock SetClientDeaths( index, deaths )
  78. {
  79. SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
  80. return 1;
  81. }
  82.