Raised This Month: $ Target: $400
 0% 

Get classname from aiming


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
KneeGrow
Junior Member
Join Date: Mar 2014
Old 07-30-2014 , 13:11   Re: Get classname from aiming
Reply With Quote #7

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 
targetbodyszClassName32 ]; 
    
get_user_aiming(idtargetbody100); 
    
pev(targetpev_classnameszClassNamecharsmax(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;


Last edited by KneeGrow; 07-30-2014 at 13:12.
KneeGrow is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode