Raised This Month: $51 Target: $400
 12% 

engine changes to pfn touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DopeFish
Senior Member
Join Date: Feb 2004
Old 03-17-2004 , 17:06   engine changes to pfn touch
Reply With Quote #1

A small test code using engine functions:
Code:
public pfn_touch(pToucher, pTouched) {         new itemClassName[MAX_NAME_LENGTH], playerClassname[MAX_NAME_LENGTH]         entity_get_string(pToucher, EV_SZ_classname, itemClassName, MAX_NAME_LENGTH-1);         entity_get_string(pTouched, EV_SZ_classname, playerClassname, MAX_NAME_LENGTH-1)         client_print(0, print_chat, "[AMXX-DEBUG] %s touched %s",playerClassname,itemClassName) }

I get the error:
Code:
test.sma(19) : error 025: function heading differs from prototype
usind the "old" vexd version works fine
Code:
public vexd_pfntouch(pToucher, pTouched) {

so what was changed to the function? and how would a correct usage of pfn_touch look like?
DopeFish is offline
Send a message via ICQ to DopeFish
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-18-2004 , 07:07  
Reply With Quote #2

public pfn_touch(ptr, ptd)
__________________
hello, i am pm
PM is offline
BAILOPAN
Join Date: Jan 2004
Old 03-18-2004 , 09:24  
Reply With Quote #3

Also be careful: It's a full forward now. return PLUGIN_HANDLED will block the call from the hl engine
__________________
egg
BAILOPAN is offline
MagicShot
Senior Member
Join Date: Mar 2004
Location: MN
Old 03-18-2004 , 10:18  
Reply With Quote #4

Quote:
Originally Posted by BAILOPAN
Also be careful: It's a full forward now. return PLUGIN_HANDLED will block the call from the hl engine
Bail whats the difference wetween a forward and a stock and natives?
__________________
|v|agic$hot
.
Without a Sound
MagicShot is offline
Send a message via MSN to MagicShot Send a message via Yahoo to MagicShot
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-18-2004 , 10:28  
Reply With Quote #5

well all of them are functions
forward: caller: amxx / a module; it is in a plugin
stock: it is normally in a .inc file, caller is the plugin, it is only included to the code if the plugin uses it
native: it is in a module or amxx core, the caller is the plugin
__________________
hello, i am pm
PM is offline
MagicShot
Senior Member
Join Date: Mar 2004
Location: MN
Old 03-18-2004 , 10:32   umm
Reply With Quote #6

So Why does a forward block a call from the hl engine?
__________________
|v|agic$hot
.
Without a Sound
MagicShot is offline
Send a message via MSN to MagicShot Send a message via Yahoo to MagicShot
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-18-2004 , 10:45  
Reply With Quote #7

this forward is called directly from a Metamod hook function. If any pfn_touch function returns PLUGIN_HANDLED, the engine module returns MRES_SUPERCEDE to metamod, which causes the function in the dll not to be called.
__________________
hello, i am pm
PM is offline
MagicShot
Senior Member
Join Date: Mar 2004
Location: MN
Old 03-18-2004 , 10:54   hmm
Reply With Quote #8

Quote:
Originally Posted by PM
this forward is called directly from a Metamod hook function. If any pfn_touch function returns PLUGIN_HANDLED, the engine module returns MRES_SUPERCEDE to metamod, which causes the function in the dll not to be called.
So if Yout put it in the return PLUGIN_HANDLED in the correct place the forward basically is null as far as doing anything?

correct?
__________________
|v|agic$hot
.
Without a Sound
MagicShot is offline
Send a message via MSN to MagicShot Send a message via Yahoo to MagicShot
DopeFish
Senior Member
Join Date: Feb 2004
Old 03-18-2004 , 12:39  
Reply With Quote #9

Quote:
Originally Posted by PM
public pfn_touch(ptr, ptd)
I feel so dumb right now, I had the solution in front of me the whole time and didn't see it
DopeFish is offline
Send a message via ICQ to DopeFish
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 03-18-2004 , 12:42  
Reply With Quote #10

Quote:
Originally Posted by DopeFish
Quote:
Originally Posted by PM
public pfn_touch(ptr, ptd)
I feel so dumb right now, I had the solution in front of me the whole time and didn't see it
no problem it is only logical that the parameter names may change...
MagicShot: i don't understand your question
__________________
hello, i am pm
PM is offline
Reply



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 22:27.


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