AlliedModders

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

Rolnaaba 12-12-2006 12:55

FM_Touch
 
correct use of FM_Touch and data it passes?
Code:
register_forward(FM_Touch, "fw_ent_touch")   public fw_ent_touch(/* what goes here? */)

Orangutanz 12-12-2006 13:02

Re: FM_Touch
 
public fw_ent_touch(ptr, ptd)

Toucher and Touched basically

Rolnaaba 12-12-2006 13:30

Re: FM_Touch
 
ok how can I get the class name of the ptd (touched)?
guessing I use
Code:
entity_get_string(ptd, EV_SZ_classname)
since I used
Code:
entity_set_string(ent, EV_SZ_classname)
to set the class name but what is the correct usage of entity_get_string in this instance?

Orangutanz 12-12-2006 13:34

Re: FM_Touch
 
Code:
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

Zenith77 12-12-2006 13:40

Re: FM_Touch
 
You shouldn't mix Fakemeta and Engine like that.

Rolnaaba 12-12-2006 13:41

Re: FM_Touch
 
I wish to use the engine way, but what is correct what to retrieve what was set by entity_set_string?
can someone show me the correct usage of entity_get_string please dont think this is right:
Code:
new class[3] entity_get_string(ptd, EV_SZ_classname, class, 3)

Orangutanz 12-12-2006 15:32

Re: FM_Touch
 
Use my method, it'll get whatever the classname is set too.

Also your example is still incorrect, look at mine how I retrieve the string value :shock:

Rolnaaba 12-13-2006 11:05

Re: FM_Touch
 
so this would work:
Code:
entity_set_string(ent, EV_SZ_classname, "test_test"); new class1[32] pev(ptd, pev_classname, class1, 31) if(contain(class1,"test_test")) {     return WOOTZOR }

P34nut 12-13-2006 11:12

Re: FM_Touch
 
that works

Rolnaaba 12-14-2006 10:43

Re: FM_Touch
 
great thanks, so I assume (since pretty much the same thing) this works as well:
Code:
if(class1 == "test_test") {      return WOOTZOR }


All times are GMT -4. The time now is 06:52.

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