Raised This Month: $ Target: $400
 0% 

Is looking at player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
KneeGrow
Junior Member
Join Date: Mar 2014
Old 07-30-2014 , 17:29   Is looking at player
Reply With Quote #1

I wanted to make a code where it will make the player use the command +attack if they are looking at another player, but I have no idea how to put it into code and have looked at other people's code but to no success.
This is what I've tried
PHP Code:
public plugin_init()
{
    
register_plugin(PLUGIN,VERSION,AUTHOR);
    
register_concmd("start","detect");
    
}
public 
detect(id){
    
    
    
    for(new 
i=1;i>0;i++){
        
        new 
target,body;
        
get_user_aiming(idtargetbody9999);
 
        if(!
is_user_alive(id))
        {
            if(
target>0){
                
client_cmd(id,"+attack");
            } else {
                
client_cmd(id,"-attack");
            }
        }
    
client_print(id,print_chat,"You are dead");
    return 
PLUGIN_HANDLED;
    }

But this ended up in me crashing and burning with it literally crashing (or at most freezing)

Last edited by KneeGrow; 07-30-2014 at 17:29.
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:04.


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