Raised This Month: $ Target: $400
 0% 

Set/Get Where player is aiming


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 08-22-2009 , 06:50   Re: Set/Get Where player is aiming
Reply With Quote #7

Quote:
Originally Posted by orglee View Post
I have problems using this function. Could you give me some small example of what to pass to it please.
You want to aim after a player. Then you must do something like this

PHP Code:
#include <amxmodx>
#include <engine>
#include <cstrike>

public plugin_init()
{
    
register_clcmd("aim""aim_func")
}

public 
aim_func(id)
{
    if (!
is_user_alive(id))
    {
        
client_print(idprint_chat"Be alive!")
        
        return 
PLUGIN_HANDLED
    
}
    
    new 
players[32],num,player
    
    get_players
(players,num,"a"// a for alive
    
    
for (new i=0;i<num;i++)
    {
        
player players[i]
        
        if (
cs_get_user_team(player) == cs_get_user_team(id))
            continue
        
        
setClientAIM(idplayer)
        
        return 
PLUGIN_HANDLED
    
}
    
    
client_print(idprint_chat"COULDN'T find an enemy player")
    return 
PLUGIN_HANDLED
}

stock setClientAIM ClientEntity )
{
    static 
Float:vecOrigin];
    static 
Float:vecTarget];
    static 
Float:angResult];

    
entity_get_vectorClientEV_VEC_originvecOrigin );
    
entity_get_vectorEntityEV_VEC_originvecTarget );

    
vecOrigin] = vecTarget] - vecOrigin];
    
vecOrigin] = vecTarget] - vecOrigin];
    
vecOrigin] = vecTarget] - vecOrigin];

    
vector_to_anglevecOriginangResult );

    
entity_set_vectorClientEV_VEC_anglesangResult );
    
entity_set_intClientEV_INT_fixangle);

__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 08-22-2009 at 06:54.
ot_207 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 15:15.


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