PHP Code:
#include <amxmodx>
new g_hudsyncobject; // this is the variable where we store the handle of created hud sync obj
public plugin_init()
{
g_hudsyncobject = CreateHudSyncObj() //here we create the hudsyncobject
set_task(1.0, "show_hud", .flags = "b"); //to display your
}
public show_hud()
{
new szMess[192];
formatex(szMess, charsmax(szMess), "This is your hud text");
set_hudmessage(255,255,255, -1.0, -1.0, 0, 1.0, 1.0, 0.1, 0.1, -1);
ShowSyncHudMsg(0, g_hudsyncobject, szMess); // here you display your hud text using that object
}
public plugin_end()
{
ClearSyncHud(0, g_hudsyncobject) // here you clear the display of hud sync object
}
above you have an example of how to display a hud message. Related to your issue, you are using ShowSyncHudMsg native BEFORE CreateHudSyncObj. That's why that error persist