Merge pull request from alliedmodders/css-clan-teamscore-mac

Update clan tag and team score offsets for cstrike ext on OS X.
This commit is contained in:
Scott Ehlert 2014-06-01 17:02:12 -05:00
commit 083edcedc7
2 changed files with 58 additions and 3 deletions
gamedata/sm-cstrike.games
plugins/testsuite

View File

@ -33,21 +33,21 @@
{ {
"windows" "24" "windows" "24"
"linux" "29" "linux" "29"
"mac" "29" "mac" "18"
} }
//Offset into CheckWinLimit to find CT team score offset from gamerules. For mac this is an offset into CCSGameRules::Think //Offset into CheckWinLimit to find CT team score offset from gamerules. For mac this is an offset into CCSGameRules::Think
"CTTeamScoreOffset" "CTTeamScoreOffset"
{ {
"windows" "18" "windows" "18"
"linux" "27" "linux" "27"
"mac" "466" "mac" "205"
} }
//Offset into CheckWinLimit to find T team score offset from gamerules. For mac this is an offset into CCSGameRules::Think //Offset into CheckWinLimit to find T team score offset from gamerules. For mac this is an offset into CCSGameRules::Think
"TTeamScoreOffset" "TTeamScoreOffset"
{ {
"windows" "56" "windows" "56"
"linux" "38" "linux" "38"
"mac" "481" "mac" "216"
} }
} }
"Signatures" "Signatures"

View File

@ -1,5 +1,6 @@
#include <sourcemod> #include <sourcemod>
#include <cstrike> #include <cstrike>
#include <sdktools>
stock GET_ARG_INT( arg, maxSize=64 ) stock GET_ARG_INT( arg, maxSize=64 )
{ {
@ -16,6 +17,10 @@ public OnPluginStart()
RegConsoleCmd( "set_score", set_score ); RegConsoleCmd( "set_score", set_score );
RegConsoleCmd( "get_assists", get_assists ); RegConsoleCmd( "get_assists", get_assists );
RegConsoleCmd( "set_assists", set_assists ); RegConsoleCmd( "set_assists", set_assists );
RegConsoleCmd( "get_clantag", get_clantag );
RegConsoleCmd( "set_clantag", set_clantag );
RegConsoleCmd( "get_teamscore", get_teamscore );
RegConsoleCmd( "set_teamscore", set_teamscore );
} }
public Action:get_mvps( client, argc ) public Action:get_mvps( client, argc )
@ -92,3 +97,53 @@ public Action:set_assists( client, argc )
return Plugin_Handled; return Plugin_Handled;
} }
public Action:get_clantag( client, argc )
{
decl String:tag[64];
CS_GetClientClanTag( client, tag, sizeof(tag) );
ReplyToCommand( client, "Your clan tag is: %s", tag );
return Plugin_Handled;
}
public Action:set_clantag( client, argc )
{
decl String:tag[64];
GetCmdArg( 1, tag, sizeof(tag) );
CS_SetClientClanTag( client, tag );
ReplyToCommand( client, "Set your clan tag to: %s", tag );
return Plugin_Handled;
}
public Action:get_teamscore( client, argc )
{
new tscore = CS_GetTeamScore( CS_TEAM_T );
new ctscore = CS_GetTeamScore( CS_TEAM_CT );
ReplyToCommand( client, "Team Scores: T = %d, CT = %d", tscore, ctscore );
return Plugin_Handled;
}
public Action:set_teamscore( client, argc )
{
new team = GET_ARG_INT( 1 );
new score = GET_ARG_INT( 2 );
if ( team != CS_TEAM_T && team != CS_TEAM_CT )
{
ReplyToCommand( client, "Team number must be %d or %d", CS_TEAM_T, CS_TEAM_CT );
return Plugin_Handled;
}
CS_SetTeamScore( team, score );
SetTeamScore( team, score );
ReplyToCommand( client, "Score for team %d has been set to %d", team, score );
return Plugin_Handled;
}