This is based on what you have so far. Though the problems with such code is that it'll show it every time the player spawns. You would also need a variable that determines if a player should see the menu, true if they are just connecting and false once they've seen it.
Consider using:
OnClientAuthorized:
http://docs.sourcemod.net/api/index....d=show&id=394&
PHP Code:
//Colorful_Peace http://steamcommunity.com/id/colorfulpeace
//Includes:
#include <sourcemod>
#pragma semicolon 1
// Info:
public Plugin:myinfo =
{
name = "n/a",
author = "Colorful Peace",
description = "n/a",
version = "1.0.0.0",
url = "N/A"
}
public OnPluginStart()
{
HookEvent("player_spawn", Event_player_spawn);
}
public Event_player_spawn(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
showMenu(client);
}
public Action:showMenu(client)
{
new Handle:menu = CreateMenuEx(GetMenuStyleHandle(MenuStyle_Radio), MenuHandler1);
SetMenuTitle(menu, "Do you like apples?");
AddMenuItem(menu, "yes", "Yes");
AddMenuItem(menu, "no", "No");
SetMenuExitButton(menu, false);
DisplayMenu(menu, client, 20);
}
public MenuHandler1(Handle:menu, MenuAction:action, param1, param2)
{
switch (action)
{
case MenuAction_Select:
{
new String:info[32];
new bool:found = GetMenuItem(menu, param2, info, sizeof(info));
PrintToConsole(param1, "You selected item: %d (found? %d info: %s)", param2, found, info);
}
case MenuAction_Cancel:
{
PrintToServer("Client %d's menu was cancelled. Reason: %d", param1, param2);
}
case MenuAction_End:
{
CloseHandle(menu);
}
}
}
__________________