Raised This Month: $ Target: $400
 0% 

[Solved] Weird Problem with get_user_aiming()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-23-2007 , 11:10   [Solved] Weird Problem with get_user_aiming()
Reply With Quote #1

Hi, i have a big problem with get_user_aiming()!
if i aim at an entity which i have created i get sometimes a valid entityID and sometimes just 0 as the ID.
I have noticed that if the entity is on a certain wall in the map i get the ID and on another wall i get 0
I would realy appreciate if someone could point me in the right direction and/or help me to solve my problem.
(Full code is also attached)

With this code i create an entity:
Code:
public entcreate()
{        
    g_entity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"));
    engfunc(EngFunc_SetModel, g_entity, g_models[g_curmodeltype]);
    
    if(g_curmodeltype == 0) set_pev(g_entity, pev_classname, MEDKITCLASS);
    else set_pev(g_entity, pev_classname, RECHARGECLASS);
    
    set_pev(g_entity, pev_controller_0, 125);
    set_pev(g_entity, pev_controller_1, 125);
    set_pev(g_entity, pev_controller_2, 125);
    set_pev(g_entity, pev_controller_3, 125);
    
    new Float:mins[3] = {-10.0, -10.0, -10.0};
    new Float:maxs[3] = {10.0, 10.0, 10.0};
    engfunc(EngFunc_SetSize, g_entity, mins, maxs);
    
    set_pev(g_entity, pev_solid, 2);
    
    setGlow(g_entity);
}
And with that i get the ID from the entity i aim at:

Code:
public del_station(id)
{
    
    new body, index;
    if(get_user_aiming(id, index, body) == 0.0) return PLUGIN_HANDLED_MAIN;
    
    log_amx("deleting initiated index: %d", index);
    
    return PLUGIN_CONTINUE;
}
This is the Console output..for 3 different Entities...
As you see 2 of them return their ID (on the wall behind the Terror-spawn on dust2) and from 1 entity i get the ID 0 (on a different wall...) :

Quote:
L 05/23/2007 - 15:11:15: [HA-Stations_v0.3.amxx] deleting initiated index: 111
L 05/23/2007 - 15:11:17: [HA-Stations_v0.3.amxx] deleting initiated index: 0
L 05/23/2007 - 15:11:18: [HA-Stations_v0.3.amxx] deleting initiated index: 110
Thanks for looking into this!
greetz regalis

And here is the full code:
Attached Files
File Type: sma Get Plugin or Get Source (HA-Stations_v0.3.sma - 744 views - 42.4 KB)
__________________

Last edited by regalis; 05-24-2007 at 17:02. Reason: removed irrelevant code..
regalis is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-24-2007 , 08:01   Re: Weird Problem with get_user_aiming()
Reply With Quote #2

Does nobody have an idea where the problem is?
I made the models by myself..is this maybe the cause?
ANY ideas/suggestions/advices/helps/hints/thoughts are appreciated!..0o

Please help me
__________________
regalis is offline
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 05-24-2007 , 15:36   Re: Weird Problem with get_user_aiming()
Reply With Quote #3

It might be the size problem. Picture shows where the entity is actually located, I also could not get a lock on the entity by aiming at it.


You can use this tool, it is very helpful with entities.
Attached Thumbnails
Click image for larger version

Name:	de_dust0000.JPG
Views:	597
Size:	72.3 KB
ID:	16362  
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.

Last edited by Cheap_Suit; 05-24-2007 at 15:39.
Cheap_Suit is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-24-2007 , 17:01   Re: Weird Problem with get_user_aiming()
Reply With Quote #4

Quote:
Originally Posted by Cheap_Suit View Post
It might be the size problem. Picture shows where the entity is actually located, I also could not get a lock on the entity by aiming at it.


You can use this tool, it is very helpful with entities.
Thank you very much for your help!
I have found the problem with this nice SHPtools you suggested.
(I had it already but never had time to test its features *lol*)

The following is happen:
If the entity which is located far under the model is in the ground i can't get its ID with get_user_aiming()..

I would like to thank you very much for pointing this out!
greetz regalis
__________________
regalis 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 10:39.


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