I've a problem with client_PreThink. When I aim at someone nothing happens. I have this code:
Code:
public client_PreThink(id) {
new player,body,name[256]
get_user_aiming(id,player,body)
if(is_user_alive(player) && is_user_alive(id) && !is_user_bot(id))
{
new health = get_user_health(player) // Get health
get_user_name(player,name,255) // Get player name
new weaponid = cs_get_weapon_id(player)
if (cs_get_user_team(player) == CS_TEAM_T)
{ // Terrorist
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "%s - Team: Terrorist - Health: %i^nWeapon holding: %s",name,health,weaponid)
} else { // Counter-Terrorist
set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0)
show_hudmessage(id, "%s - Team: Counter-Terrorist - Health: %i^nWeapon holding: %s",name,health,weaponid)
}
}
}