Raised This Month: $ Target: $400
 0% 

aimkill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-26-2005 , 15:30   aimkill
Reply With Quote #1

how do i make an function that kills a player if <playerid> aims at him, but onley if <playerid> is in an radius of let's say 10meters from him?
I allso wanna know how to use get_cvar_num()! (make the value of mp_freesetime a variable)

hope you understood!
__________________
Sig(h)!
Obbin is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-26-2005 , 15:42  
Reply With Quote #2

Code:
public kill_user_aiming(id)
{
	new tid, body;
	get_user_aiming(id,tid,body,100)

	if(is_valid_ent(tid) && tid <= get_maxplayers() ) user_kill(tid,1);
}
Code:
new cvar_value = get_cvar_num("cvarname")
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-27-2005 , 05:17  
Reply With Quote #3

how would i do if the user that <someone> is aiming @ onley gets killed if <someone> and <someone #2> is closer then 10 meters from eatchother?
__________________
Sig(h)!
Obbin is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-27-2005 , 05:28  
Reply With Quote #4

Code:
public RawrKill(id) {     new tid,body;     get_user_aiming(id,tid,body,9999);     if(is_user_alive(id) && is_user_alive(tid))     {         new distance = floatround(entity_range(id,tid));         if(floatround(distance/32.00) <= 10)             user_kill(tid,1);     } }
Tis how I would do it.
__________________
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
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-27-2005 , 06:57  
Reply With Quote #5

Thx, v3x and twlight!
__________________
Sig(h)!
Obbin is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-27-2005 , 15:22  
Reply With Quote #6

Quote:
Originally Posted by v3x
Code:
public RawrKill(id) {     new tid,body;     get_user_aiming(id,tid,body,9999);     if(is_user_alive(id) && is_user_alive(tid))     {         new distance = floatround(entity_range(id,tid));         if(floatround(distance/32.00) <= 10)             user_kill(tid,1);     } }
Tis how I would do it.
First off, 10 isn't ten meters. Ten is ten units, IE, ten inches or so.

Second, why not handle it completely in the engine, by simply making get_user_aiming do the work? It can't capture people that are not alive, and the last parameter is how far they are from one another.

Thats just wasting CPU.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-27-2005 , 15:56  
Reply With Quote #7

Quote:
Originally Posted by Twilight Suzuka
the last parameter is how far they are from one another.
The last parameter is the distance get_user_aiming is allowed to check, the actual distance between them is returned by the native.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-27-2005 , 16:09  
Reply With Quote #8

Exactly. So if you want it below ten meters, you set it to about 100, and it'll check to see if their within that radius.

12 * 3 * 3 = 108, 100 being a good approximate distance.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-27-2005 , 16:36  
Reply With Quote #9

uh.. any example twlight or avalanche?
(i readed at funcwiki.php but i didn't undrestand)
__________________
Sig(h)!
Obbin is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-27-2005 , 17:48  
Reply With Quote #10

If im reading what twilight and ava have said:
Code:
public DieDamnit(id) {     new tid,body;     new distance = get_user_aiming(id,tid,body,100);   //change last number there to go farther     if(is_user_alive(tid))         user_kill(tid , 1); }

[EDIT] Fixed
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Reply


Thread Tools
Display Modes

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 14:25.


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