Raised This Month: $ Target: $400
 0% 

Distance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-23-2005 , 23:21   Distance
Reply With Quote #1

Alright.. for get_user_aiming(), what is the distance measured in?

Also, what would be the approximate distance between you and another player side by side?

EDIT:
Actually, I want to get the distance between 2 players. So I assume I'd use get_user_origin() and get_distance().
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-24-2005 , 00:06  
Reply With Quote #2

Yeah.. I was wondering this as well. I give out a bonus 1 exp for a "long range" hit, which is >= 1500 units. But then, apparently I got a long range hit (according to debug chat) with a knife. But then.. my server I think is completely screwed up
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
Rosbief
Junior Member
Join Date: Jul 2004
Location: Poor Little Belgium
Old 04-24-2005 , 12:59   maybe
Reply With Quote #3

Code:
new userorigin[3]
get_userorigin(id , userorigin , 0)

new useroriginsecondperson[3]
get_userorigin(target , useroriginsecondperson , 0)

if ( get_distance(userorigin , useroriginsecondperson) <= 60 ) {
 // Code here 
}
Something simular.
Offcourse you need to change the secondpersonorigin.
It's only a example

or more what you would like

Code:
new userorigin[3]
get_user_origin ( id , userorigin , 0 )

new target , body
get_user_aiming ( id, target, body, 9999 )

new targetorigin[3]
get_user_origin (target , targetorigin , 0)

if ( get_distance(userorigin , targetorigin) <= 60 ) {
 // Code here 
}
Now the maximum distance is 9999 , but you can change that.
I'm not quite sure whats the distance side by side.
Maybe try somethim around 100.

Hope this helped
__________________
Userbar Signature + Stats:
http://www.bfcorp.aonservers.com/sigs/amxx/

Rosbief is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-24-2005 , 14:50  
Reply With Quote #4

Hmm, I was gonna use get_entity_distance().. Anywho, thanks.. This plugin will be interesting when I'm done.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Cronck
Member
Join Date: Apr 2005
Old 04-24-2005 , 15:02  
Reply With Quote #5

Maybe someone could help me with this...

I need to make a heal function for my Mod. The users calls a command when pointing at a teammate, and it should heal him if the distance isn't very far.

get_user_aiming() // Does this return the id of the user its pointing at?
And how do i set the function only to be run if the distance is like a max of 2 meters?
Cronck is offline
Rosbief
Junior Member
Join Date: Jul 2004
Location: Poor Little Belgium
Old 04-24-2005 , 15:27   basicaly
Reply With Quote #6

you can just use the code i gave v3x.

Code:
new target , body
get_user_aiming ( id, target, body, 9999 )

set_user_health ( target , get_user_health(target) + 10 )
This does:

if person a looks at person b,
it gives person b +10 hp
__________________
Userbar Signature + Stats:
http://www.bfcorp.aonservers.com/sigs/amxx/

Rosbief is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-24-2005 , 16:49  
Reply With Quote #7

Could I use http://amxmodx.org/funcwiki.php?go=func&id=379 ?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Rosbief
Junior Member
Join Date: Jul 2004
Location: Poor Little Belgium
Old 04-25-2005 , 13:31   yes
Reply With Quote #8

yes that would work to
__________________
Userbar Signature + Stats:
http://www.bfcorp.aonservers.com/sigs/amxx/

Rosbief is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-25-2005 , 15:26  
Reply With Quote #9

Alright .. Would that work if a knife hit somebody? Like, id hit id2.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Rosbief
Junior Member
Join Date: Jul 2004
Location: Poor Little Belgium
Old 04-25-2005 , 18:25   well
Reply With Quote #10

don't know foir sure.
its two ents touching so if people touch dont know for sure if knife.

maybe make it like

on ent touching
if id has knife equipeed and attack button?
but don't know for sure.
__________________
Userbar Signature + Stats:
http://www.bfcorp.aonservers.com/sigs/amxx/

Rosbief 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 09:53.


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