pretty sure not really
noodleboy I did that already as you can see in the todo list of my credit plugin, here's the code:
PHP Code:
#include <tf2_stocks>
public OnPluginStart()
{
RegAdminCmd("sm_candy_buy_uber", cBuyUber, ADMFLAG_BAN, "Get instant uber (medic)");
}
public Action:cBuyUber(cclient, args)
{
new String:sErrStr[] = "[candypack] Usage: sm_candy_buy_uber <userid> <percent>";
if (args < 2)
{
PrintToServer(sErrStr);
return Plugin_Handled;
}
new String:sclient[32];
GetCmdArg(1, sclient, sizeof(sclient));
new client = GetClientOfUserId(StringToInt(sclient));
if (!FullCheckClient(client))
{
PrintToServer(sErrStr);
return Plugin_Handled;
}
new String:sonoff[32];
GetCmdArg(2, sonoff, sizeof(sonoff));
new onoff = StringToInt(sonoff);
if (TF2_GetPlayerClass(client) == TF2_GetClass("medic"))
{
new iSlot = GetPlayerWeaponSlot(client, 1);
if (iSlot > 0)
SetEntPropFloat(iSlot, Prop_Send, "m_flChargeLevel", onoff*0.01);
new String:name[128];
GetClientName(client, name, sizeof(name));
PrintToChatAll("Gave %s %i\% ubercharge!", name, onoff);
}
return Plugin_Handled;
}
public bool:FullCheckClient(client)
{
if (client < 1)
return false;
if (!IsClientConnected(client))
return false;
if (!IsClientInGame(client))
return false;
if (IsFakeClient(client))
return false;
return true;
}