AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Entities (https://forums.alliedmods.net/showthread.php?t=143668)

Lightokun 11-22-2010 18:33

Entities
 
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.

Schwabba 11-22-2010 22:19

Re: Entities
 
I would try it with Ham_Touch.

Lightokun 11-23-2010 13:48

Re: Entities
 
Ok, i'll try it.
And what about this? Not at home till Sunday, can't check.
register_forward(FM_Touch, "fwdTouch");

Exolent[jNr] 11-23-2010 14:05

Re: Entities
 
Would be better to use register_touch with "func_wall" classnames.

Lightokun 11-24-2010 23:46

Re: Entities
 
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.

drekes 11-25-2010 15:22

Re: Entities
 
are you sure both are entities and both classes are func_wall ?

Lightokun 11-25-2010 19:15

Re: Entities
 
Yes, i'm sure. When player touches entity it's registered in log and it doesn't matter, which method i use.

Emp` 11-25-2010 20:28

Re: Entities
 
func_walls may not "touch" other entities. you could check mins/maxs of all func_walls when one func_wall is moved.

Exolent[jNr] 11-26-2010 00:52

Re: Entities
 
Quote:

Originally Posted by Lightokun (Post 1356542)
Anyone?

Don't bump until 2 weeks have passed since last post.


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

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