#include <amxmodx>
#include <cstrike>
#include <zombieplague>
#include <colorchat>
new players[33][32]
new num[33]
public plugin_init()
{
// Register the plugin
register_plugin("[ZP] Classes In Chat", "1.0", "@bdul!")
// Client say commands
register_clcmd("say", "hook_say")
register_clcmd("say_team", "hook_team_say")
}
public hook_say(id)
{
// Process what he is speaking
new chat[192]
read_args(chat, 191)
remove_quotes(chat)
// Get his name
new name[32]
get_user_name(id, name, 31)
// Get his team
new CsTeams:userteam = cs_get_user_team(id)
// If he has written nothing then return
if(equal(chat, ""))
return PLUGIN_HANDLED
// Check if he is alive
if (is_user_alive(id))
{
// He is a zombie
if (zp_get_user_zombie(id))
{
if (zp_get_user_nemesis(id))
{
ColorChat(0, RED, "[Nemesis] ^x04%s^x01: %s", name, chat);
}
else
{
ColorChat(0, RED, "[Zombie] ^x04%s^x01: %s", name, chat);
}
}
// This means he is a human
else
{
if (zp_get_user_survivor(id))
{
ColorChat(0, BLUE, "[Tulelo] ^x04%s^x01: %s", name, chat);
}
else
{
ColorChat(0, BLUE, "[Ember] ^x04%s^x01: %s", name, chat);
}
}
}
// He is dead
else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR)
{
ColorChat(0, GREY, "[Halott] ^x04%s^x01: %s", name, chat);
}
// Else he is a spectator
else
{
ColorChat(0, GREY, "[Nezo] ^x04%s^x01: %s", name, chat);
}
return PLUGIN_HANDLED
}
public hook_team_say(id)
{
// Process his team say
new chat[192]
read_args(chat, 191)
remove_quotes(chat)
// Get his Name
new name[32], team[32]
get_user_name(id, name, 31)
// He has written nothing then return
if(equal(chat, ""))
return PLUGIN_HANDLED
// Get his team
new CsTeams:userteam =cs_get_user_team(id)
// He is a zombie
if (zp_get_user_zombie(id))
{
if (get_players(players[id], num[id], _, "TERRORIST"))
{
if (zp_get_user_nemesis(id))
team = "[Nemesis]"
else
team = "[Zombie]"
}
}
// Else he is a human
else
{
if (get_players(players[id], num[id], _, "CT"))
{
if (zp_get_user_survivor(id))
team = "[Survivor]"
else
team = "[Human]"
}
}
// Start the loop
for (new a = 0; a < num[id]; ++a)
{
new i = players[id][a]
// He is alive
if (is_user_alive(id))
{
if (zp_get_user_zombie(id))
ColorChat(i, RED, "%s^x04(Team Message) %s^x01: %s",team, name, chat);
else
ColorChat(i, BLUE, "%s^x04(Team Message) %s^x01: %s",team, name, chat);
}
// Else he dead
else if (!is_user_alive(id) && userteam != CS_TEAM_SPECTATOR)
{
ColorChat(i, GREY, "[Halott]^x04(Team Message) ^x03%s^x01: %s", name, chat);
}
// Else he is a spectator
else
{
ColorChat(i, GREY, "[Nezo]^x04(Team Message) ^x03%s^x01: %s", name, chat);
}
}
return PLUGIN_HANDLED
}