How about this? And you can modify the code however you want ;)
This code is less hardcoded and it supports any gamemode installed on the server, it works only for zp50 ;)
PHP Code:
#include < amxmodx >
#include < zp50_gamemodes >
new g_desc[32];
new g_msghud;
public plugin_init()
{
register_plugin("[ZP] Game Modes Display", "1.0", "funkyfresh95");
register_event("TextMsg", "event_restart", "a", "2&#Game_C", "2&#Game_w");
register_event("HLTV", "event_hltv", "a", "1=0", "2=0");
formatex(g_desc, charsmax(g_desc), "No infection.. Yet..");
g_msghud = CreateHudSyncObj();
}
public client_putinserver(id)
{
if( !is_user_bot(id) )
set_task(1.0, "task_show_info", id + 100, _, _, "b");
}
public client_disconnect(id)
remove_task(id + 100);
public event_hltv()
formatex(g_desc, charsmax(g_desc), "No infection.. Yet..");
public event_restart()
formatex(g_desc, charsmax(g_desc), "No infection.. Yet..");
public zp_fw_gamemodes_start(game_mode_id)
{
new name[32];
zp_gamemodes_get_name(game_mode_id, name, charsmax(name));
formatex(g_desc, charsmax(g_desc), "%s", name);
}
public task_show_info(taskid)
{
new id = taskid - 100;
set_hudmessage(255, 0, 0, -1.0, 0.02, 0, 6.0, 1.1, 0.0, 0.0, -1);
ShowSyncHudMsg(id, g_msghud, "Current Mode: %s", g_desc);
}
__________________