Greetings all! Well I figured out if I wanted a prober RPG I'd have to create one myself.
I'm currently working with the following code. My problem is that I cannot check werether the user selects Upgrade, sell or anything else. I actually just edited one of the tutorial codes in the documentation.
Code:
#include <sourcemod>
public Plugin:myinfo =
{
name = "SourceRPG",
author = "realchamp",
description = "SourceRPG",
version = "1.0.0.0",
url = "http://cfx.dk"
};
public OnPluginStart()
{
RegConsoleCmd("rpgmenu", RPG_MAIN);
}
public PanelHandler1(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
PrintToConsole(param1, "You selected item: %d", param2);
} else if (action == MenuAction_Cancel) {
PrintToServer("Client %d's menu was cancelled. Reason: %d", param1, param2);
}
}
public Action:RPG_MAIN(client, args)
{
new Handle:panel = CreatePanel();
SetPanelTitle(panel, "SourceRPG Main Menu");
DrawPanelItem(panel, "Upgrades");
DrawPanelItem(panel, "Sell");
DrawPanelItem(panel, "Help");
DrawPanelItem(panel, "Exit");
SendPanelToClient(panel, client, PanelHandler1, 20);
CloseHandle(panel);
return Plugin_Handled;
}
-- realchamp.
__________________