Skip to content

Commit

Permalink
Add test command to ttt_api_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Bara committed Nov 28, 2017
1 parent d145795 commit 7088c91
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions addons/sourcemod/scripting/ttt_api_test.sp
Expand Up @@ -28,6 +28,26 @@ public void OnPluginStart()
CreateConVar("ttt2_api_test_version", TTT_PLUGIN_VERSION, TTT_PLUGIN_DESCRIPTION, FCVAR_NOTIFY | FCVAR_DONTRECORD | FCVAR_REPLICATED);

HookEvent("weapon_fire", Event_WeaponFire);

RegAdminCmd("sm_uitem", Command_UItem, ADMFLAG_ROOT);
}

public Action Command_UItem(int client, int args)
{
if (args != 2)
{
ReplyToCommand(client, "sm_uitem <item name (short)> <price>");
return Plugin_Handled;
}

char arg1[MAX_NAME_LENGTH], arg2[5];

GetCmdArg(1, arg1, sizeof(arg1));
GetCmdArg(2, arg2, sizeof(arg2));

TTT_UpdateCustomItem(arg1, StringToInt(arg2));

return Plugin_Continue;
}

public void OnConfigsExecuted()
Expand Down

0 comments on commit 7088c91

Please sign in to comment.