Welcome to Sourcemod
What you searching for is:
Quote:
FakeClientCommand(client, "sm_trails"); // This forces a client to write "sm_trails" in his console
|
One solution:
PHP Code:
public Action:ShowMenu( client ){
new Handle:menu = CreateMenu( YourMenuHandler );
SetMenuTitle( menu, "Menu Title" );
AddMenuItem( menu, "hello1", "Hello1");
AddMenuItem( menu, "hello2", "Hello2" );
AddMenuItem( menu, "hello3", "Hello3" );
SetMenuExitButton( menu, true );
DisplayMenu( menu, client, MENU_TIME_FOREVER );
}
public YourMenuHandler( Handle:menu, MenuAction:action, param1, param2 ){
if ( action == MenuAction_Select ){
decl String:info[64];
GetMenuItem( menu, param2, info, sizeof( info ));
if( StrEqual( info, "hello1" )){
FakeClientCommand(param1, "sm_trails"); //param1 is the client who choosed the menu item
}
else if( StrEqual( info, "hello2" )){
FakeClientCommand(param1, "sm_trails"); //param1 is the client who choosed the menu item
}
else if( StrEqual( info, "hello3" )){
FakeClientCommand(param1, "sm_trails"); //param1 is the client who choosed the menu item
}
}
else if ( action == MenuAction_End ){
CloseHandle( menu );
}
}