I have another suggestion. It would be great if you could add targeting to addUpgrade, giveRandomUpgrade, and removeUpgrade.
I did make a new addUpgrade so it allows targeting (e.g. addupgrade 5 tommy, addupgrade 5 @all). The code is below. The same can be done for giveRandomUpgrade and removeUpgrade with some copy and paste and little editing. I used your indexes not built in ones.
Code:
public Action:addUpgrade(client, args)
{
new upgIndex = 0;
if (args >= 1)
{
decl String:arg1[3];
GetCmdArg(1, arg1, sizeof(arg1));
if (StringToIntEx(arg1, upgIndex) == 0 || upgIndex < 0 || upgIndex > 13)
{
ReplyToCommand(client, "Invalid Upgrade Index. Valids are 0 to 13");
return Plugin_Handled;
}
else if (args == 1)
{
GiveClientSpecificUpgrade(client, upgIndex);
}
}
if (args > 1)
{
decl String:arg[65];
GetCmdArg(2, arg, sizeof(arg));
decl String:target_name[MAX_TARGET_LENGTH];
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
if ((target_count = ProcessTargetString(
arg,
client,
target_list,
MAXPLAYERS,
COMMAND_FILTER_ALIVE,
target_name,
sizeof(target_name),
tn_is_ml)) <= 0)
{
ReplyToTargetError(client, target_count);
return Plugin_Handled;
}
for (new i = 0; i < target_count; i++)
{
GiveClientSpecificUpgrade(target_list[i], upgIndex);
}
}
if (args < 1)
{
ReplyToCommand(client, "Usage: addupgrade [upgrade id] <#userid|name>");
}
return Plugin_Handled;
}
LoadTranslations("common.phrases");
should also be added to public OnPluginStart()