PC Gamer,
Thank you for your reply.
It still not working for me.
My goal is to create a menu and call command for plugin that I installed.
For example, I installed F-18 Airstrike (
https://forums.alliedmods.net/showthread.php?t=187567 ). If I typed
sm_strike in the console it will bring up the Air Strike Menu. I would like to call the same command from the my own menu instead of typing it console.
I confirmed the if statement is getting hit becuase ServerCommand("sm_slap Player1"); work in that statement, but ServerCommand("sm_strike"); is not working.
Please see code below.
PHP Code:
public PMenu(Handle:menu, MenuAction:action, param1, param2)
{
switch (action)
{
case MenuAction_Select:
{
new String:item[64];
GetMenuItem(menu, param2, item, sizeof(item));
if (StrEqual(item,"Option1"))
{
//this DO NOT work when call from the menu
ServerCommand("sm_strike");
//This work when call from the menu.
ServerCommand("sm_slap Player1");
}
}
case MenuAction_End:
{
delete menu;
}
}
}