Raised This Month: $51 Target: $400
 12% 

Find bombsite class!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-01-2013 , 06:13   Find bombsite class!
Reply With Quote #1

Hello guys. How to get Bombsite A and Bombsite B valid cordiantes?

I am probaly this code:
PHP Code:
stock find_bomb_targets(Float:location1[3],Float:location2[3])
{
    new 
ent1=find_ent_by_class(32,"func_bomb_target")
    new 
ent2=find_ent_by_class(ent1,"info_bomb_target")
    
get_brush_entity_origin(ent1location1)
    
get_brush_entity_origin(ent2location2)
    return 
PLUGIN_CONTINUE

and dont set valid cordiantes? Example: I am set user orifin the bombsite origin, and put in the wall! Thanks for helping.
__________________
kiki33hun is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-01-2013 , 09:43   Re: Find bombsite class!
Reply With Quote #2

XY-problem will only make your plugin bad.

This works fine for me. I tried it by running beampoints along the Z-axis and both of them hit the red cross on de_dust.
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("", "", "");     new Float:locations[2][3]     find_bomb_targets(locations);     server_print("Location 1: %d, %d, %d", floatround(locations[0][0]), floatround(locations[0][1]), floatround(locations[0][2]));     server_print("Location 2: %d, %d, %d", floatround(locations[1][0]), floatround(locations[1][1]), floatround(locations[1][2])); } stock find_bomb_targets(Float:locations[2][3]) {     new ent, i;     while ( i < 2 && (ent = find_ent_by_class(ent,"func_bomb_target") ) ) {         get_brush_entity_origin(ent, locations[i]);         i++;     } }

Code:
Location 1: 1952, 608, 80
Location 2: 352, -1656, 128
__________________

Last edited by Black Rose; 09-01-2013 at 11:00.
Black Rose is offline
kiki33hun
Veteran Member
Join Date: Jul 2011
Location: Magyarország
Old 09-02-2013 , 01:30   Re: Find bombsite class!
Reply With Quote #3

Thanks worked.
__________________
kiki33hun is offline
devilicioux
Veteran Member
Join Date: Jun 2013
Location: Delhi,India
Old 09-02-2013 , 05:04   Re: Find bombsite class!
Reply With Quote #4

Sweet !! can we direct player somehow to the closest bombsite or show him direction via some sprite or something or beam or anything ?
__________________
You keep bringing ANTICHRISTUS down .. He will rise again and kick asses !

#RespectList ANTICHRISTUS fysiks Bugsy

Most Common Errors You Can Encounter Every Now and Then
devilicioux is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 09-02-2013 , 14:30   Re: Find bombsite class!
Reply With Quote #5

Quote:
Originally Posted by devilicioux View Post
Sweet !! can we direct player somehow to the closest bombsite or show him direction via some sprite or something or beam or anything ?
https://forums.alliedmods.net/showthread.php?t=225234
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
G[o]Q
Member
Join Date: Jan 2010
Location: Poland (Malopolska)
Old 09-03-2013 , 10:13   Re: Find bombsite class!
Reply With Quote #6

i Use something like that

Code:
public find_all_bombsites(){
    new bs = -1
    while ((bs = find_ent_by_class(bs, "func_bomb_target"))){
        bomb_sites_ids[bomb_sites_count]=bs;
        entity_get_vector(bs,EV_VEC_absmin,bomb_sites[bomb_sites_count][MINS]);
        entity_get_vector(bs,EV_VEC_absmax,bomb_sites[bomb_sites_count++][MAXS]);
    }
    while ((bs = find_ent_by_class(bs, "info_bomb_target"))){
        bomb_sites_ids[bomb_sites_count]=bs;
        entity_get_vector(bs,EV_VEC_absmin,bomb_sites[bomb_sites_count][MINS]);
        entity_get_vector(bs,EV_VEC_absmax,bomb_sites[bomb_sites_count++][MAXS]);
    }
}
and
Code:
#define MAX_BS 5

new Float:bomb_sites[MAX_BS][2][3]
new bomb_sites_ids[MAX_BS];
new bomb_sites_count=0;

enum {MINS=0,MAXS=1}
remember there are maps with 3 bomb-sites or with 1 bomb-site
G[o]Q is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-03-2013 , 12:09   Re: Find bombsite class!
Reply With Quote #7

You can have a look to c4 management plugin, all you have to do is to implement brush origin and to store it in the dynamic array.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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:17.


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