AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get walking ground origin or smthn (https://forums.alliedmods.net/showthread.php?t=133861)

outsiderlv 07-29-2010 13:39

Get walking ground origin or smthn
 
PHP Code:

        new id read_data(2)
        new 
iOrigin[3]
        
iOrigin[0] = read_data(3)
        
iOrigin[1] = read_data(4)
        
iOrigin[2] = read_data(5)
        new 
iPlayerOrigin[3]
        
get_user_origin(idiPlayerOrigin)
        
        new 
iDistance get_distance(iPlayerOriginiOrigin)
        
        new 
name[35];
        
get_user_name(id,name,34);

        
        
ColorChat(0RED"^x03%s^x01 spray'd^x04 %d units^x01 high!",name,iDistance); 

I need to get the distance from ground, not the person. How can i do that?

Bugsy 07-29-2010 13:49

Re: Get walking ground origin or smthn
 
iOrigin[ 2 ] is the z value. See if this holds distance from ground.

outsiderlv 07-29-2010 14:01

Re: Get walking ground origin or smthn
 
How? I tried to use this:
iOrigin[1] = 100
But that was wrong. So if i try this:
iOrigin[2] = 100
it can be ok, right?
Or mby I should try this:
iOrigin[2] = pev(client, pev_origin, origin);
Damn.. Im so newbie at this.. Please help. :)

outsiderlv 07-29-2010 14:27

Re: Get walking ground origin or smthn
 
Sorry for dp, but i dont need z origin. I need y. I need to get the distance from the ground to the spray (height):
^
|
|
Like that.. :D

Bugsy 07-29-2010 16:12

Re: Get walking ground origin or smthn
 
Right, do a print of iOrigin[ 2 ] after the read_data(5), this may hold what youre looking for.

outsiderlv 08-07-2010 14:33

Re: Get walking ground origin or smthn
 
What do you mean with print? I have to type print after read_data(5)?

Bugsy 08-07-2010 14:42

Re: Get walking ground origin or smthn
 
iOrigin[ 2 ] holds z value. Whatever you plan on doing with the value you need, use that.

outsiderlv 08-07-2010 14:58

Re: Get walking ground origin or smthn
 
Can you say it in code? :?

Bugsy 08-07-2010 15:53

Re: Get walking ground origin or smthn
 
new the_value_you_want = iOrigin[ 2 ];

outsiderlv 08-08-2010 02:48

Re: Get walking ground origin or smthn
 
PHP Code:

        new id read_data(2)
        new 
iOrigin[3]
        
iOrigin[0] = read_data(3)
        
iOrigin[1] = read_data(4)
        
iOrigin[2] = read_data(5)
        
        new 
iPlayerOrigin[3]
        
get_user_origin(idiPlayerOrigin)
        new 
iDistance get_distance(iPlayerOriginiOrigin[2]) 

It isnt working.. <_< Errors compiling..


All times are GMT -4. The time now is 00:12.

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