I'm trying to display the owners name of their weapon type on Team Fortress Classic. Some reason out of the 3 weapons below only the concussion grenade will display the real owner. The other 2 will display the servers host name. Does anyone know why this is and how to fix it?
PHP Code:
public hook_SetModel(ent, model[])
{
// THIS WILL GET THE REAL OWNERS NAME
if(equali(model, "models/conc_grenade.mdl"))
{
new id = pev(ent, pev_owner);
new name[33];
get_user_name(id, name, 32);
client_print(0, print_chat, "%s used a conc.", name);
concsUsed[id] += 1;
}
// THIS GETS THE SERVERS NAME
if(equali(model, "models/pipebomb.mdl"))
{
new id = pev(ent, pev_owner);
new name[33];
get_user_name(id, name, 32);
client_print(0, print_chat, "%s used a pipe.", name);
pipesUsed[id] += 1;
}
// THIS GETS THE SERVERS NAME
if(equali(model, "models/rpgrocket.mdl"))
{
new id = pev(ent, pev_owner);
new name[33];
get_user_name(id, name, 32);
client_print(0, print_chat, "%s used a rocket.", name);
rocketsUsed[id] += 1;
}
return FMRES_HANDLED;
}