Raised This Month: $ Target: $400
 0% 

Entities


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lightokun
Member
Join Date: Oct 2009
Old 11-22-2010 , 18:33   Entities
Reply With Quote #1

Hello, i need help again.
I need to check if entity with class func_wall is in another entity with class func_wall and if it is, i need to know (return) both entities ids.
It's for basebuilder mod. Like some player moved entity func_wall to gates(func_wall, name: barrier) and when it touches gates - remove moved entity.
__________________
Lightokun is offline
Schwabba
Senior Member
Join Date: Apr 2008
Old 11-22-2010 , 22:19   Re: Entities
Reply With Quote #2

I would try it with Ham_Touch.
Schwabba is offline
Lightokun
Member
Join Date: Oct 2009
Old 11-23-2010 , 13:48   Re: Entities
Reply With Quote #3

Ok, i'll try it.
And what about this? Not at home till Sunday, can't check.
register_forward(FM_Touch, "fwdTouch");
__________________
Lightokun is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-23-2010 , 14:05   Re: Entities
Reply With Quote #4

Would be better to use register_touch with "func_wall" classnames.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Lightokun
Member
Join Date: Oct 2009
Old 11-24-2010 , 23:46   Re: Entities
Reply With Quote #5

Nothing (ham, fm, engine) can register func_wall touch func_wall.

Fakemeta:
Code:
register_forward(FM_Touch, "fwdTouch")

public fwdTouch(ptr, ptd)
{
    log_amx("ptr: %d; ptd: %d", ptr, ptd)
    if(ptr == 0 || ptd == 0) return // 0 = World, can't get settings from this
    new class1[32], class2[32]
    pev(ptr, pev_classname, class1, 31) // Toucher
    pev(ptd, pev_classname, class2, 31) // Touched
    
    client_print(0, print_chat, "%s touched %s", class1, class2)
}
log_amx only return values when player touches something.

Ham:
Code:
RegisterHam(Ham_Touch, "func_wall", "hamTouch_wall")

public hamTouch_wall(ptr, ptd)
{
    log_amx("ptr: %d; ptd: %d", ptr, ptd)
    if(ptr == 0 || ptd == 0) return // 0 = World, can't get settings from this
    new class1[32], class2[32]
    pev(ptr, pev_classname, class1, 31) // Toucher
    pev(ptd, pev_classname, class2, 31) // Touched
    
    client_print(0, print_chat, "%s touched %s", class1, class2)
}
Same here, only log player touches something.

Engine:
Code:
register_touch("*", "*", "engine_touch") or register_touch("func_wall", "func_wall", "engine_touch")
.. same code
Same situation.
I'm in dispair.
__________________

Last edited by Lightokun; 11-24-2010 at 23:49.
Lightokun is offline
Old 11-25-2010, 15:00
Lightokun
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 11-26-2010 , 00:52   Re: Entities
Reply With Quote #7

Quote:
Originally Posted by Lightokun View Post
Anyone?
Don't bump until 2 weeks have passed since last post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 11-25-2010 , 15:22   Re: Entities
Reply With Quote #8

are you sure both are entities and both classes are func_wall ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Lightokun
Member
Join Date: Oct 2009
Old 11-25-2010 , 19:15   Re: Entities
Reply With Quote #9

Yes, i'm sure. When player touches entity it's registered in log and it doesn't matter, which method i use.
__________________
Lightokun is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-25-2010 , 20:28   Re: Entities
Reply With Quote #10

func_walls may not "touch" other entities. you could check mins/maxs of all func_walls when one func_wall is moved.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Reply


Thread Tools
Display Modes

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 11:20.


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