#include <sdktools_functions>
public void OnPluginStart()
{
RegConsoleCmd("sm_giveweapon", GiveWeapon);
}
Action GiveWeapon(int iClient, int args)
{
if(iClient == 0 && args > 0)
{
char sBuffer[32];
GetCmdArg(1, sBuffer, sizeof(sBuffer));
if(!sBuffer[0]) return Plugin_Handled;
int iTarget = GetClientOfUserId(StringToInt(sBuffer));
if(iTarget < 1 || !IsClientInGame(iTarget) || IsFakeClient(iTarget)) return Plugin_Handled;
GetCmdArg(2, sBuffer, sizeof(sBuffer));
if(!sBuffer[0]) return Plugin_Handled;
GivePlayerItem(iTarget, sBuffer);
}
return Plugin_Handled;
}