AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [HELP] Getting Rescue Zone Coords Properly (https://forums.alliedmods.net/showthread.php?t=333186)

hellmonja 06-23-2021 15:33

[HELP] Getting Rescue Zone Coords Properly
 
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?...

HamletEagle 06-24-2021 08:44

Re: [HELP] Getting Rescue Zone Coords Properly
 
get_brush_entity_origin
You can look inside my Bomb Status plugin. It has code to teleport to a bombsite without getting stuck.

hellmonja 06-25-2021 12:09

Re: [HELP] Getting Rescue Zone Coords Properly
 
Quote:

Originally Posted by HamletEagle (Post 2750975)
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...

HamletEagle 06-25-2021 15:44

Re: [HELP] Getting Rescue Zone Coords Properly
 
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.

hellmonja 06-27-2021 16:07

Re: [HELP] Getting Rescue Zone Coords Properly
 
Quote:

Originally Posted by HamletEagle (Post 2751126)
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...


All times are GMT -4. The time now is 02:39.

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