AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get_user_aim help... (https://forums.alliedmods.net/showthread.php?t=46997)

k007 11-06-2006 23:00

get_user_aim help...
 
how do i find...
1. if user is aiming at bot
2. aining at one player
3. aiming at more than one player
4. at a ent with a certian model or type...etc
ty..

teame06 11-06-2006 23:22

Re: get_user_aim help...
 
For question 3 I dunno. With get_user_aiming it not possible though.

Code:
function(id) {     new body, index;     get_user_aiming(id, index, body);     if(0 < index > get_maxplayers())     {         if(is_user_bot(index))         {               // Is bot         } else {             // Player         }       } else if(index > get_maxplayers()) {         // Entity         By checking the classname, model, or etc     } }

k007 11-06-2006 23:25

Re: get_user_aim help...
 
so 2 returns the first one is players the second one is entites? and for 3 can't i like if the index is higher than 1 or something, i mean whats the diffrence when look at one index or 2 won't the id return more than 1?

teame06 11-06-2006 23:30

Re: get_user_aim help...
 
No, first parameter of get_user_aiming is the person who you are checking their aim. Second argument is what entity index is return byref. So if the index is greater than 0 and less than or equal 32 than it is a player. If it Greater than 32 than it an entity.

k007 11-06-2006 23:32

Re: get_user_aim help...
 
so there is no possible way to find if out if hes aiming at more than one player...?
edit: how about tryin to use find_ent_in_sphre on the index of the player like when u check if he is aimin at someone and then check if there is players beside that player(in the sphre) but i need the index of the aimed at player!?

The Specialist 11-06-2006 23:47

Re: get_user_aim help...
 
Code:
function(id) {     new body, index;     get_user_aiming(id, index, body);     if(0 < index > get_maxplayers())     {         if(is_user_bot(index))         {               // Is bot         } else {             // Player           find_sphere_class(0,"player",MAX_DISTANCE ,entlist,700 , 1 )         }       } else if(index > get_maxplayers()) {         // Entity         By checking the classname, model, or etc     } }

k007 11-06-2006 23:50

Re: get_user_aim help...
 
ur code make no sence i want 4 return bot, player, more than one player, entity

VEN 11-07-2006 04:36

Re: get_user_aim help...
 
Use traceline for #3.

organizedKaoS 11-07-2006 12:21

Re: get_user_aim help...
 
For #3...jghg made a plugin that sends an enemy spotted radio message with an alt message saying how many enemys spotted....by how many are in sight of the transmitting player.

Maybe his code could help you there.

Enemy Spotted::JGHG

VEN 11-07-2006 13:20

Re: get_user_aim help...
 
He said "aiming", this is a different things.
Quote:

aiming at more than one player


All times are GMT -4. The time now is 06:55.

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