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

Brush Index


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-17-2009 , 19:32   Brush Index
Reply With Quote #1

Hello evryone,

How can I get the brush index on wich ur standing?
I need to save that index to a number so when im standing on a brush i can retrieve on wich number I am standing.

Hope someone can help me out.

Greetz Grim.
__________________
I am out of order!
grimvh2 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 10-17-2009 , 22:49   Re: Brush Index
Reply With Quote #2

Quote:
Originally Posted by grimvh2 View Post
Hello evryone,

How can I get the brush index on wich ur standing?
I need to save that index to a number so when im standing on a brush i can retrieve on wich number I am standing.

Hope someone can help me out.

Greetz Grim.
The only "index" you can get from a brush, is if it's a brush entity. If that's what you want - do you want it for all types of brush entities?
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-18-2009 , 03:48   Re: Brush Index
Reply With Quote #3

pev( id, pev_groundentity );
__________________
xPaw is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-18-2009 , 05:51   Re: Brush Index
Reply With Quote #4

It seems most brushes are the same.
Im using it on kz_beginner.
I save some brushes with a number, and when im standing on one of them it sais im standing on all of them.
But when I stand on the healer in the start it sais im not standing on a saved brush.

PHP Code:
public Show_Block(id)
{
    new 
ent pev(idpev_groundentity)
    
    for( new 
1blocksi++)
    {
        if(
block[i] == ent)
        {        
            
ColorChat(idRED"^x01[^x04Kreedz Cup^x01] Your standing on block %i",i)
        }
    }
}

// save brush
block[blocks] = pev(idpev_groundentity)
blocks++ 
__________________
I am out of order!
grimvh2 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-18-2009 , 06:13   Re: Brush Index
Reply With Quote #5

Are you sure the ents are right?
__________________
xPaw is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-18-2009 , 06:25   Re: Brush Index
Reply With Quote #6

Screen :

http://www.speedyshare.com/561846883.html

Im standing on block 1, so i save it as block 1,
then i go to block 2 and i save it as block 2,

now when im standing on block one
It said :
You are standing on block 1
You are standing on block 2

It sais that on evry block but when I am on the healer it doesnt say im on any saved block.
Makes me think block 1 and block 2 get saved as the same :s

Also when im standing on the startbutton it also say im not on a saved block.
__________________
I am out of order!
grimvh2 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-18-2009 , 07:18   Re: Brush Index
Reply With Quote #7

I'd suggest you to save pev_model of entities not entity id, because it can change. and the block not always can be entity, it may be just worldspawn
__________________
xPaw is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-18-2009 , 07:46   Re: Brush Index
Reply With Quote #8

Same problem again.

edit :

when Im doing this :

PHP Code:
new Float:block[120][3];
new 
blocks;

new 
ent pev(idpev_groundentity)
pev(entpev_originblock[blocks])

client_print(id,print_chat,"%f %f %f",block[blocks][0],block[blocks][1],block[blocks][2]) 
Im getting 0.00000 0.00000 0.00000
__________________
I am out of order!

Last edited by grimvh2; 10-18-2009 at 11:04.
grimvh2 is offline
grimvh2
Veteran Member
Join Date: Nov 2007
Location: Fishdot Nation
Old 10-19-2009 , 11:50   Re: Brush Index
Reply With Quote #9

Anybody got an idea where it goes wrong, I kinda need this
(sorry for the bump, I know)
__________________
I am out of order!

Last edited by grimvh2; 10-19-2009 at 11:50. Reason: srr bumped
grimvh2 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-19-2009 , 12:17   Re: Brush Index
Reply With Quote #10

Brushes are defined by their bounds. Try this:

PHP Code:
new Float:min[3], Float:max[3], Float:add[3], Float:origin[3]
peventpev_absminmin )
peventpev_absmaxmax )

xs_vec_addminmaxadd )
xs_vec_div_scalaradd2.0origin )

client_print0print_chat"[Brush Origin] x: %f / y: %f / z: %f"origin[0], origin[1], origin[2] ) 
__________________

Last edited by Hawk552; 10-19-2009 at 12:17. Reason: changed from xs_vec_mul_scalar to xs_vec_div_scalar
Hawk552 is offline
Send a message via AIM to Hawk552
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 13:22.


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