plugins/testsuite/cstrike-test.sp
author Ryan Stecker <voidedweasel@gmail.com>
Wed Jul 03 23:14:55 2013 -0400 (2013-07-03)
changeset 3929 0bc0ffdb2eba
parent 3706 54f55b538cb2
child 3961 0dc477c29792
permissions -rw-r--r--
Fixed ReadMapList not seeing maps in all valveFS paths (bug 5715, r=asherkin).
     1 #include <sourcemod>
     2 #include <cstrike>
     3 
     4 stock GET_ARG_INT( arg, maxSize=64 )
     5 {
     6 	decl String:tempvar[maxSize];
     7 	GetCmdArg( arg, tempvar, maxSize );
     8 	return StringToInt( tempvar );
     9 }
    10 
    11 public OnPluginStart()
    12 {
    13 	RegConsoleCmd( "get_mvps",    get_mvps    );
    14 	RegConsoleCmd( "set_mvps",    set_mvps    );
    15 	RegConsoleCmd( "get_score",   get_score   );
    16 	RegConsoleCmd( "set_score",   set_score   );
    17 	RegConsoleCmd( "get_assists", get_assists );
    18 	RegConsoleCmd( "set_assists", set_assists );
    19 }
    20 
    21 public Action:get_mvps( client, argc )
    22 {
    23 	ReplyToCommand( client, "Your MVP count is %d", CS_GetMVPCount( client ) );
    24 	
    25 	return Plugin_Handled;
    26 }
    27 
    28 public Action:set_mvps( client, argc )
    29 {
    30 	new count = GET_ARG_INT( 1 );
    31 	
    32 	CS_SetMVPCount( client, count );
    33 	ReplyToCommand( client, "Set your MVP count to %d", count );
    34 	
    35 	return Plugin_Handled;
    36 }
    37 
    38 public Action:get_score( client, argc )
    39 {
    40 	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
    41 	{
    42 		ReplyToCommand( client, "This command is only intended for CS:GO" );
    43 		return Plugin_Handled;
    44 	}
    45 	
    46 	ReplyToCommand( client, "Your contribution score is %d", CS_GetClientContributionScore( client ) );
    47 
    48 	return Plugin_Handled;
    49 }
    50 
    51 public Action:set_score( client, argc )
    52 {
    53 	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
    54 	{
    55 		ReplyToCommand( client, "This command is only intended for CS:GO" );
    56 		return Plugin_Handled;
    57 	}
    58 	
    59 	new count = GET_ARG_INT( 1 );
    60 	
    61 	CS_SetClientContributionScore( client, count );
    62 	ReplyToCommand( client, "Set your contribution score to %d", count );
    63 
    64 	return Plugin_Handled;
    65 }
    66 
    67 public Action:get_assists( client, argc )
    68 {
    69 	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
    70 	{
    71 		ReplyToCommand( client, "This command is only intended for CS:GO" );
    72 		return Plugin_Handled;
    73 	}
    74 	
    75 	ReplyToCommand( client, "Your assist count is %d", CS_GetClientAssists( client ) );
    76 
    77 	return Plugin_Handled;
    78 }
    79 
    80 public Action:set_assists( client, argc )
    81 {
    82 	if( GuessSDKVersion() != SOURCE_SDK_CSGO )
    83 	{
    84 		ReplyToCommand( client, "This command is only intended for CS:GO" );
    85 		return Plugin_Handled;
    86 	}
    87 	
    88 	new count = GET_ARG_INT( 1 );
    89 	
    90 	CS_SetClientAssists( client, count );
    91 	ReplyToCommand( client, "Set your assist count to %d", count );
    92 
    93 	return Plugin_Handled;
    94 }