AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Solved] Getting Entity Origins (https://forums.alliedmods.net/showthread.php?t=144434)

TheKidz 12-03-2010 21:38

[Solved] Getting Entity Origins
 
PHP Code:

public plugin_precache( ) {
    
RegisterHamHam_Spawn"func_pushable""Fwd_SpawnPushable")
}
public 
Fwd_SpawnPushableiEnt ) {
    new 
Float:iOrigin]
    
peviEntpev_originiOrigin )
    
server_print"%f %f %f"iOrigin], iOrigin], iOrigin] )
    
remove_entityiEnt )


server_print:
Code:

0.000000 0.000000 1.000000
im sure the entity isnt in that origins... so... whats the problem ?

Exolent[jNr] 12-03-2010 22:18

Re: Getting Entity Origins
 
You have to get the brush entity origin (absmax - absmin).

TheKidz 12-03-2010 22:52

Re: Getting Entity Origins
 
and how should i do this ? example please if its possible ;x

Exolent[jNr] 12-04-2010 00:06

Re: Getting Entity Origins
 
Search.

TheKidz 12-04-2010 14:00

Re: Getting Entity Origins
 
yea, the power of search :D
thanks exolent !
took from arkshine's help:
PHP Code:

stock fm_get_brush_entity_originindexFloat:origin] ) {
    new 
Float:mins], Float:maxs]
    
pev(indexpev_minsmins)
    
pev(indexpev_maxsmaxs)

    
origin] = ( mins] + maxs] ) * 0.5
    origin
] = ( mins] + maxs] ) * 0.5
    origin
] = ( mins] + maxs] ) * 0.5

    
return 1;




abdul-rehman 12-04-2010 14:08

Re: [Solved] Getting Entity Origins
 
Well what r brush entities and
Why does pev_origin returns a false value for brush entities ?

drekes 12-04-2010 15:17

Re: [Solved] Getting Entity Origins
 
Quote:

Originally Posted by abdul-rehman (Post 1363067)
Well what r brush entities and
Why does pev_origin returns a false value for brush entities ?

Brush entities are like func_wall and stuff that are created by the map itself.
I had the same problem a while ago, i didn't know this was possible, so i fixed it on a very stupid way :oops:

Don't know why it's returning false value's.


All times are GMT -4. The time now is 11:27.

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