AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can't prevent pickup :( (https://forums.alliedmods.net/showthread.php?t=51087)

Shaman 02-11-2007 07:00

Can't prevent pickup :(
 
My function is this.
PHP Code:

public event_touch(touched,toucher)
    {
    if(
toucher==0||touched==0)
        {
        return 
PLUGIN_HANDLED
        
}
    
    new 
touchedcn[33]
    new 
touchercn[33]
    
pev(touched,pev_classname,touchedcn,32)
    
pev(toucher,pev_classname,touchercn,32)
    new 
message[201]
    
format(message,200,"Toucher:'%i' CN:'%s' Touched:'%i' CN:'%s'",toucher,touchercn,touched,touchedcn)
    
console_print(0,message)
    return 
PLUGIN_HANDLED
    


When I try to get a weapon or an item, this function prints the message to console; but I get the weapon. How can I prevent pickup?

VEN 02-11-2007 07:42

Re: Can't prevent pickup :(
 
return FMRES_SUPERCEDE

Shaman 02-11-2007 08:20

Re: Can't prevent pickup :(
 
I read this in http://www.amxmodx.org/doc/source/fu...core/index.htm :
Quote:


//Plugin halts continued operation (plugins following in the plugins.ini won't be called).
//Whatever called it will eventually supercede.
PLUGIN_HANDLED 1
So this is only for engine hooks right?

Edit:
I forgot to add: It worked.

VEN 02-11-2007 13:34

Re: Can't prevent pickup :(
 
For FM_* hooks you should return FMRES_* values. See fakemeta_const.inc/docs/funcwiki for details.


All times are GMT -4. The time now is 00:37.

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