Hi,
So i'm trying to keep a panel opened as long as another one is opened, and open this one back when the old one is closed.
For example;
I have InfoPanel that needs to be opened all time, can't be closes
If i want to open xPanel then xPanel shows up, InfoPanel get closed, and when xPanel get closed then InfoPanel get opened back
At the moment, i'm doing this
PHP Code:
public void OnPluginStart()
{
HookEvent("player_spawn", TimerAfficherHubSpawn);
}
public Action:TimerAfficherHubSpawn(Handle:hEvent, const String:szName[], bool:bDontBroadcast)
{
new iClient = GetClientOfUserId(GetEventInt(hEvent, "userid"));
CreateTimer(0.5, afficherHUBRespawn, iClient, TIMER_REPEAT);
}
public Action:afficherHUBRespawn(Handle timer, client)
{
new Handle:WPanel = CreatePanel(INVALID_HANDLE);
SetPanelTitle(WPanel, "title");
DrawPanelText(WPanel, "text: ?");
DrawPanelText(WPanel, "text: ?");
DrawPanelText(WPanel, "text: ?");
DrawPanelText(WPanel, "text: ?");
DrawPanelText(WPanel, "text: ?");
DrawPanelText(WPanel, "text: ?");
SendPanelToClient(WPanel, client, NullMenuHandler, 20);
//CloseHandle(WPanel);
}
public NullMenuHandler(Handle:WPanel, MenuAction:action, param1, param2)
{
CloseHandle(WPanel);
}
but, thing is if i do a command like /admin, the admin menu doesn't show up. It does but get insta closed...
Any idea on how i need to do this ?