Hi, I'm a starter in sourcepawn and i would like to make a panel where everythings is blank so I can do this but i wan't it to display when the player connect to the server so i tried this
PHP Code:
#include <sourcemod>
#include <cstrike>
#include <adminmenu>
public OnPluginStart()
{
HookEvent("player_respawned", test_panel);
}
public PanelHandler1(Handle:menu, MenuAction:action, param1, param2)
{
if (action == MenuAction_Select)
{
PrintToConsole(param1, "", param2);
} else if (action == MenuAction_Cancel) {
PrintToServer("", param1, param2);
}
}
public Action:test_panel(Handle:event, const String:name[], bool:dontBroadcast)
{
new userid = GetEventInt(event, "userid"); // Get player #userid from event player_death
new client = GetClientOfUserId(userid); // Get client index by #userid
new Handle:panel = CreatePanel();
SetPanelTitle(panel, "Test Panel");
DrawPanelItem(panel, "Test2", ITEMDRAW_RAWLINE);
DrawPanelItem(panel, "Test1", ITEMDRAW_RAWLINE);
SendPanelToClient(panel, client, PanelHandler1, 99999);
}
but it didn't work so if someone can help me that'll be cool. I'm on CS:GO.
edit : I would like the panel to update every second if possible (for changing a date or something)