Raised This Month: $32 Target: $400
 8% 

Solved [HELP] Getting Rescue Zone Coords Properly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 06-23-2021 , 15:33   [HELP] Getting Rescue Zone Coords Properly
Reply With Quote #1

So I'm trying to make this plugin where as a CT you can teleport to the hostage rescue zone from anywhere near the map. I'm trying to get the coordinates for the rescue zone like so:
PHP Code:
new entity = -1Float:tmpOrigin[3];
while ((
entity find_ent_by_class(entity"func_hostage_rescue")))
    {
        
entity_get_vector(entity,EV_VEC_origin,tmpOrigin)
        
FVecIVec(tmpOriging_rescuezone_orgs)
    }
    
        
entity = -1
    
while ((entity find_ent_by_class(entity"info_hostage_rescue")))
    {
        
entity_get_vector(entity,EV_VEC_origin,tmpOrigin)
        
FVecIVec(tmpOriging_rescuezone_orgs)
    } 
But the coordinates take me nowhere near the rescue zone. I've tried this on several cs_ maps. How do you actually get its coordinates properly?...
__________________

Last edited by hellmonja; 06-25-2021 at 12:41. Reason: Solved...
hellmonja is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-24-2021 , 08:44   Re: [HELP] Getting Rescue Zone Coords Properly
Reply With Quote #2

get_brush_entity_origin
You can look inside my Bomb Status plugin. It has code to teleport to a bombsite without getting stuck.
__________________

Last edited by HamletEagle; 06-24-2021 at 08:45.
HamletEagle is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 06-25-2021 , 12:09   Re: [HELP] Getting Rescue Zone Coords Properly
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
get_brush_entity_origin
You can look inside my Bomb Status plugin. It has code to teleport to a bombsite without getting stuck.
Cool! It has everything I need and actually works. I was wondering why always get stuck on the floor. In some maps the location is a bit off but that's okay. The worse is probably Italy. I don't know why it teleports me somewhere in market.

Anyway, it never occurred to me until now that hostages don't follow if you're too far away. The plugin as is is practically useless in its intended purpose but I can use these codes on something else. Thanks man...
__________________
hellmonja is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-25-2021 , 15:44   Re: [HELP] Getting Rescue Zone Coords Properly
Reply With Quote #4

You should try lowering the range in which it searches for a valid origin. It's likely too big and that's why you end up somewhere else.
__________________
HamletEagle is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 06-27-2021 , 16:07   Re: [HELP] Getting Rescue Zone Coords Properly
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
You should try lowering the range in which it searches for a valid origin. It's likely too big and that's why you end up somewhere else.
Roger that. Set it from +-250 to +-50. I think it's working fine now...
__________________
hellmonja 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 20:31.


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