Quote:
Originally Posted by meTaLiCroSS
"Touch" is called whenever an entities touchs another entity (or world itself).
It has 2 arguments:
1) "pentTouched" which is the touched entity
2) "pentOther" which is the toucher, this one can be the world
Whenever "touch" is called, you must guess that 2 touch forwards will be called. The second callback will have the args flipped.
If ent1 touches ent2 and ent2 is not world:
Touch(ent1, ent2)
Touch(ent2, ent1)
Use register_touch instead of using Fakemeta's FM_Touch because you'll hook many touch callback, when you'll just check for an specific entity touch. (if it's the case)
|
PHP Code:
public fw_touch(ent, touched)
{
if (!pev_valid(ent))
return FMRES_IGNORED
static entclass[32], entclass2[32]
pev(ent, pev_classname, entclass, charsmax(entclass))
pev(touched, pev_classname, entclass2, charsmax(entclass2))
if(equali(entclass, "amxx_pallets") && equali(entclass2, "player") && is_user_alive(touched))
{
set_pev(ent ,pev_solid, SOLID_NOT)
}
return FMRES_IGNORED
}
I'm having trouble.
"ent" is doing fusion with the "touched"