Raised This Month: $ Target: $400
 0% 

Need code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-14-2010 , 14:36   Need code
Reply With Quote #1

Hey,
someone can tell me the code if im aiming at players body it follow (example: a chain lightning)? I need only code without lightning.. If someone can help me it will be very usefull
Vechta is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 07-14-2010 , 14:51   Re: Need code
Reply With Quote #2

PHP Code:
new ententbody
get_user_aiming
(idententbody)

if(
ent)
{
    new 
szClassname[32]
    
pev(entpev_classnameszClassnamecharsmax(szClassname)
    
    if(
equal(szClassname"player")
    {
        
// code
    
}
}

// put it in prethink 
__________________
I am out of order!
grimvh2 is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-14-2010 , 14:58   Re: Need code
Reply With Quote #3

Quote:
Originally Posted by grimvh2 View Post
PHP Code:
new ententbody
get_user_aiming
(idententbody)

if(
ent)
{
    new 
szClassname[32]
    
pev(entpev_classnameszClassnamecharsmax(szClassname)
    
    if(
equal(szClassname"player")
    {
        
// code
    
}
}

// put it in prethink 
ehm, thank you you can include also distance code?
Vechta is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-14-2010 , 15:38   Re: Need code
Reply With Quote #4

solved

Last edited by Vechta; 07-14-2010 at 15:40.
Vechta is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-14-2010 , 15:40   Re: Need code
Reply With Quote #5

at "if" statement add another bracket ")" at end.
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Vechta
Veteran Member
Join Date: Jun 2010
Old 07-14-2010 , 15:43   Re: Need code
Reply With Quote #6

Quote:
Originally Posted by Alka View Post
at "if" statement add another bracket ")" at end.
solved but can you give me code for distance please ?
Vechta is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 07-14-2010 , 16:16   Re: Need code
Reply With Quote #7

Quote:
Originally Posted by Alka View Post
at "if" statement add another bracket ")" at end.
Yep, and another one at pev heres good :

PHP Code:
new ententbody 
get_user_aiming
(idententbodydistance// just change distance with an int

if(ent

    new 
szClassname[32
    
pev(entpev_classnameszClassnamecharsmax(szClassname)) 
     
    if(
equal(szClassname"player"))
    { 
        
// code 
    



// put it in prethink 
__________________
I am out of order!
grimvh2 is offline
PattyBiena
BANNED
Join Date: Jul 2010
Location: Argentina
Old 07-14-2010 , 16:16   Re: Need code
Reply With Quote #8

Quote:
Originally Posted by Vechta View Post
solved but can you give me code for distance please ?
PHP Code:
public any_public(id)
{
    new 
ententbody
    get_user_aiming
(idententbody)
    
    if(
ent)
    {
        new 
szClassname[32], originF[3], originF2[3]
        
        
pev(entpev_classnameszClassnamecharsmax(szClassname))
        
get_user_origin(entoriginF)
        
get_user_origin(idoriginF2)
        
        if(
equal(szClassname"player") && get_distance(originForiginF2) > 500.0)
        {
            
// code
        
}
    } 

PattyBiena is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 07-14-2010 , 16:18   Re: Need code
Reply With Quote #9

Quote:
Originally Posted by PattyBiena View Post
PHP Code:
public any_public(id)
{
    new 
ententbody
    get_user_aiming
(idententbody)
    
    if(
ent)
    {
        new 
szClassname[32], originF[3], originF2[3]
        
        
pev(entpev_classnameszClassnamecharsmax(szClassname))
        
get_user_origin(entoriginF)
        
get_user_origin(idoriginF2)
        
        if(
equal(szClassname"player") && get_distance(originForiginF2) > 500.0)
        {
            
// code
        
}
    } 

why in god's name would u do that?

Code:
Description
  get_user_aiming - Traces where a player is aiming for a maximum  distance defaulted to 9999.
  get_user_aiming ( index, &id,  &body, [ distance ] )
__________________
I am out of order!
grimvh2 is offline
Reply



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 07:04.


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