sm_cvar net_showevents 2 output:
Code:
Server event "weapon_fire", Tick 1826:
- "userid" = "2"
- "weapon" = "pistol"
- "weaponid" = "1"
- "count" = "1"
Server event "infected_hurt", Tick 1826:
- "attacker" = "2"
- "entityid" = "426"
- "hitgroup" = "1"
- "amount" = "28"
- "type" = "1073741826"
Server event "player_death", Tick 1826:
- "userid" = "0"
- "entityid" = "426"
- "attacker" = "2"
- "attackername" = ""
- "attackerentid" = "0"
- "weapon" = "dual_pistols"
- "headshot" = "1"
- "attackerisbot" = "0"
- "victimname" = "Infected"
- "victimisbot" = "1"
- "abort" = "0"
- "type" = "1073741826"
- "victim_x" = "772.49"
- "victim_y" = "5566.61"
- "victim_z" = "2690.03"
Server event "infected_death", Tick 1826:
- "attacker" = "2"
- "infected_id" = "0"
- "gender" = "1"
- "weapon_id" = "1"
- "headshot" = "1"
- "minigun" = "0"
- "blast" = "0"
- "submerged" = "0"
spitter
Code:
Server event "player_death", Tick 3935:
- "userid" = "6"
- "entityid" = "0"
- "attacker" = "2"
- "attackername" = ""
- "attackerentid" = "0"
- "weapon" = "dual_pistols"
- "headshot" = "1"
- "attackerisbot" = "0"
- "victimname" = "Spitter"
- "victimisbot" = "1"
- "abort" = "0"
- "type" = "1073741826"
- "victim_x" = "1530.55"
- "victim_y" = "6111.80"
- "victim_z" = "2691.53"
*edit
plugin example
PHP Code:
enum {
Infected = 0,
Smoker,
Boomer,
Hunter,
Spitter,
Jockey,
Charger,
unknown,
Tank,
Survivor,
Witch
};
char infected[][] = {
"Infected",
"Smoker",
"Boomer",
"Hunter",
"Spitter",
"Jockey",
"Charger",
"unknown",
"Tank",
"Survivor",
"Witch"
}
public void OnPluginStart()
{
HookEvent("player_death", player_death);
}
public void player_death(Event event, const char[] name, bool dontBroadcast)
{
// no headshot
if(!event.GetBool("headshot"))
return;
//if(event.GetBool("attackerisbot"))
// return;
int attacker = GetClientOfUserId(event.GetInt("attacker"));
// attacker not found by userid
if(!attacker)
return;
int victim = event.GetInt("entityid");
if(!victim)
{
victim = GetClientOfUserId(event.GetInt("userid"));
if(!victim)
return;
}
char buffer[15];
int m_zombieClass = 0;
if(HasEntProp(victim, Prop_Send, "m_zombieClass"))
{
m_zombieClass = GetEntProp(victim, Prop_Send, "m_zombieClass");
}
else
{
event.GetString("victimname", buffer, sizeof(buffer));
if(StrEqual(buffer, infected[Witch], false))
m_zombieClass = Witch; // this class is now customized manually...
}
switch(m_zombieClass)
{
case Infected:
{
}
default:
{
PrintToChatAll("\x03[HEADSHOT %s]\x01 %N", infected[m_zombieClass], attacker);
}
}
}
__________________