I have worked out a solution myself to add these options to the menu and execute them.
Because the "userid" gets put into an int I made all the menu options numbers
Menu
Code:
AddMenuItem(menu, "99", "All");
AddMenuItem(menu, "98", "Bots");
AddMenuItem(menu, "97", "Humans");
AddMenuItem(menu, "96", "Current Aim");
AddMenuItem(menu, "95", "Me");
AddMenuItem(menu, "94", "Everyone But Me");
AddMenuItem(menu, "93", "Red Team");
AddMenuItem(menu, "92", "Blue Team");
AddTargetsToMenu(menu, client, true, false);
This is "userid" that gets put into an int under
Code:
else if (action == MenuAction_Select)
{
decl String:info[32];
new userid, target;
GetMenuItem(menu, param2, info, sizeof(info));
userid = StringToInt(info);
After this I added a few if statements to check for the numbers I gave in the menu section and execute the command if number is found.
Code:
if (userid == 99)
{
ClientCommand(param1, "sm_explode @all");
}
else if (userid == 98)
{
ClientCommand(param1, "sm_explode @bots");
}
else if (userid == 97)
{
ClientCommand(param1, "sm_explode @humans");
}
else if (userid == 96)
{
ClientCommand(param1, "sm_explode @aim");
}
else if (userid == 95)
{
ClientCommand(param1, "sm_explode @me");
}
else if (userid == 94)
{
ClientCommand(param1, "sm_explode @!me");
}
else if (userid == 93)
{
ClientCommand(param1, "sm_explode @red");
}
else if (userid == 92)
{
ClientCommand(param1, "sm_explode @blue");
}
This enabled me to add options to the menu like @all and @red aswell as the full list of players.
This is my first time editing these plugins so I am not sure if this is the correct way to solve this problem.
My solution works, but if there is a better way could anyone explain it?
Thanks.