All right recently someone on this foru helped me to make a plugin which always kept a building menu up. The problem is that now my server allways prints out error messages:
PHP Code:
Displaying call stack trace for plugin "PanelUP.smx":
L 04/21/2011 - 01:42:32: [SM] [0] Line 53, D:\Games\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\scripting\PanelUP.sp::Menu_Building()
L 04/21/2011 - 01:42:32: [SM] [1] Line 42, D:\Games\steamapps\common\left 4 dead 2\left4dead2\addons\sourcemod\scripting\PanelUP.sp::MenuBuildingHandler()
L 04/21/2011 - 01:42:32: [SM] Plugin encountered error 8: Not enough space on the stack
+ Sometimes my server crashes on map change or suddenly CPU usage goest up to 100 % and I guess that that means it is having memory leaks
PS Ive also got some warnings on compilation. Anyways here is the code.
PHP Code:
#include <sourcemod>
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo =
{
name = "Panel Up",
author = "blackalegator",
description = "Keep the panel up",
version = "PLUGIN_VERSION",
url = "",
}
public Action:Timer_Name(Handle:timer, any:client)
{
if(!IsClientConnected(client)) return Plugin_Stop;
if(IsPlayerAlive(client))
{
Menu_Building(client);
}
return Plugin_Continue;
}
public OnClientConnected(client)
{
CreateTimer(15.0, Timer_Name, client, TIMER_REPEAT);
}
public MenuBuildingHandler(Handle:menu, MenuAction:action, client, param2)
{
/* If an option was selected, build. */
if (action == MenuAction_Select)
{
new String:info[128];
GetMenuItem(menu, param2, info, sizeof(info));
FakeClientCommand(client, info);
Menu_Building(client);
}
/* If the menu was cancelled, show menu. */
else if (action == MenuAction_Cancel)
{
Menu_Building(client);
}
/* If the menu has ended, show menu */
else if (action == MenuAction_End)
{
CloseHandle(menu);
}
}
Menu_Building(client)
{
new Handle:menu = CreateMenu(MenuBuildingHandler);
SetMenuTitle(menu, "Build your barricade!");
AddMenuItem(menu, "fortspawn_remove", "Remove object you are aiming at");
AddMenuItem(menu, "fortspawn_irondoor", "Safe Room Door");
AddMenuItem(menu, "fortspawn_item d a models/props_unique/airport/temp_barricade.mdl", "Temp Fence");
AddMenuItem(menu, "fortspawn_item d a models/props_junk/wood_crate001a.mdl", "Wood Crate");
AddMenuItem(menu, "fortspawn_item d a models/props_fortifications/concrete_wall001_96_reference.mdl", "Concrete Wall");
AddMenuItem(menu, "fortspawn_item d a models/props_urban/fence_cover001_128.mdl", "Fence Cover");
AddMenuItem(menu, "fortspawn_rotate 45", "Rotate 45 degrees");
SetMenuExitButton(menu, false);
DisplayMenu(menu, client, 60);
return Plugin_Handled;
}
__________________