I hate catching audio/text events, so lame.... blah
Heres how I did it, it can also be done using register_logevent
Code:
public plugin_log()
{
new logdata0[128], logdata1[64], logdata2[64], logdata3[64]
new name[32], id
//Get the args from the log data
read_logargv(0,logdata0,127)
read_logargv(1,logdata1,63)
read_logargv(2,logdata2,63)
read_logargv(3,logdata3,63)
//Individual Events
if (equal(logdata1,"triggered")) {
//Get the username and id out
parse_loguser(logdata0, name, 31)
id = get_user_index(name)
//Hostage Events
if (equal(logdata2,"Rescued_A_Hostage")) {
hostRescued(id)
}
else if (equal(logdata2,"Killed_A_Hostage")) {
hostKilled(id)
}
//Bomb Events
else if (equal(logdata2,"Spawned_With_The_Bomb")) {
bombHolder(id)
}
else if (equal(logdata2,"Got_The_Bomb")) {
bombHolder(id)
}
else if (equal(logdata2,"Planted_The_Bomb")) {
bombPlanted(id)
}
else if (equal(logdata2,"Defused_The_Bomb")) {
bombDefused(id)
}
}
//Team Events
else if (equal(logdata3,"All_Hostages_Rescued")) {
allHostRescued()
}
else if (equal(logdata3,"Target_Bombed")) {
bombExploded()
}
}
when you see things like "hostRescued(id)" that is me calling another function to handle the event. You can pick and choose which ones to catch. plugin_log is a forward so it gets called automatically with each log event.
__________________