after it checks if the player is looking at a door
then returns plugin handled
just in case, here is the whole thing
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
new const doorbell[] = "sound/misc/doorbell.wav"
public plugin_precache(){
precache_sound(doorbell);
}
public plugin_init(){
register_plugin("Doorbell","1.0","urAdingdong");
register_clcmd("say /doorbell","dingdong");
}
public dingdong(id){
new target, body, szClassName[ 32 ];
get_user_aiming(id, target, body, 100);
pev(target, pev_classname, szClassName, charsmax(szClassName));
if(equal(szClassName, "func_door_rotating"))
{
emit_sound(id,CHAN_AUTO,doorbell,VOL_NORM,ATTN_NORM,0,PITCH_NORM);
return PLUGIN_HANDLED;
}
client_print(id,print_chat,"You must be near a door");
return PLUGIN_HANDLED;
}