First off, create a global array that will contain your colors and grab the mod id using zp_gamemodes_get_id in plugin_init new MyColors[3], NemesisID public plugin_init() { register_plugin("[ZP] Game Modes Display", "1.0", "lol");
formatex(g_desc, charsmax(g_desc), "No mode available");
g_msghud = CreateHudSyncObj();
NemesisID = zp_gamemodes_get_id("Nemesis Mode") //The name of the mode as registered in it's plugin_precache() //zp_gamemodes_register("Nemesis Mode") }
Create a function to edit your colors or just do it directly public SetColors(Red,Green,Blue) { MyColors[0] = Red MyColors[1] = Green MyColors[2] = Blue }
Then in your game mode start forward and add a switch case that works around the game mode id 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); new MyCurrModID = zp_gamemodes_get_current() switch(MyCurrModID) { case NemesisID: SetColors(255,0,0) default: SetColors(255,255,255) //undefined, you didn't select a color for this mod //You could case NemesisID,DragonID,NightCrawlerID: SetColors(255,0,0) and so on } } next: set_hudmessage(255, 117, 24, -1.0, 0.02, 0, 6.0, 1.1, 0.0, 0.0, -1); please change it to set_hudmessage(MyColors[0], MyColors[1],MyColors[2], -1.0, 0.02, 0, 6.0, 1.1, 0.0, 0.0, -1);