AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Function istriggered is not configured in hamdata.ini. (https://forums.alliedmods.net/showthread.php?t=85470)

Dr.G 02-11-2009 07:13

Function istriggered is not configured in hamdata.ini.
 
I tryed to catch a flag cap with Ham using Ham_IsTriggered, but it gives me this error:

PHP Code:

/* Error quote:
[AMXX] Plugin ("Ham_IsTriggered.amxx") is setting itself as failed.
[AMXX] Plugin says: Function istriggered is not configured in hamdata.ini.
[AMXX] Displaying debug trace (plugin "Ham_IsTriggered.amxx")
[AMXX] Run time error 1: forced exit 
[AMXX]    [0] hamsandwich.inc::__fatal_ham_error (line 376)
*/ 

any of you who knows if Ham_IsTriggered would work on dod? Or is that the simple reason why its not configured in hamdata.ini ? or maybe forgotten? I can see its configured to cstrike, tfc, ns, ts, efs, esf_openbeta and valve, linux and windows. In ini
Quote:

Version: $Id: hamdata.ini 3687 2008-03-04 18:51:35Z sawce $
Or are there any other way i can catch a flag cap? My test goes like this:

PHP Code:

#include <amxmodx>
#include <hamsandwich>
#define PLUGIN "flag test"
#define VERSION "1.0"
#define AUTHOR "Dr.G"
 
 
/* Console quote:
Team "Axis" triggered a "dod_capture_area" - "POINT_AVALANCHE_MARKET"
"Played @ *=GO=*'s today!GG!<370><STEAM_0:1:21700583><Axis>" triggered a "dod_capture_area" - "POINT_AVALANCHE_MARKET" */
 
public plugin_init() 
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
RegisterHam(Ham_IsTriggered"dod_capture_area""Flag_Cap",1)
 
 
/* ExecuteHam(Ham_IsTriggered, this, idActivator); */
}
public 
Flag_Cap(id)
{
 new 
name[33]
 
get_user_name(id,name,32)
 
 if(
is_user_connected(id))
 {
  
client_print(id,print_center,"%s you capped a flag")
 }
 return 
HAM_IGNORED


Thanks in advance!

ConnorMcLeod 02-11-2009 11:14

Re: Function istriggered is not configured in hamdata.ini.
 
Seems that the forward doesn't exists for dod or that sawce hasn't found the offset.


IF it was existing, your code would be wrong and should be :

public Flag_Cap(iEnt, id) (supposing dod_capture_area is an existing entity)


If you only want to catch when this is triggered, you can run this plugin :
PHP Code:

#include <amxmodx>

new g_iState

public plugin_init()
{
    
register_plugin("LogEvents Logger""1.0.0""connorr")
    
register_srvcmd("logevents""ServerCommand_LogEvents"_"<print> | <log> | <stop>")
}

public 
plugin_log()
{
    if(!
g_iState)
    {
        return
    }

    static 
szMain[256], szDetail[256], szRegistered[256]
    static 
iArgsNumnmszTemp[64]

    
read_logdata(szMain255)

    
iArgsNum read_logargc()

    
0
    m 
formatex(szRegistered255"register_logevent(^"function_name^", %d"iArgsNum)

    for(new 
ii<iArgsNumi++)
    {
        
read_logargv(iszTemp63)
        
+= formatex(szDetail[n], 255-n"^n%d=%s"iszTemp)
        
+= formatex(szRegistered[m], 255-m", ^"%d=%s^""iszTemp)
    }
    
+= formatex(szRegistered[m], 255-m")^n")

    if(
g_iState==2)
    {
        static const 
logfile[] = "logevents.log"
        
log_to_file(logfile"^n%s%s^n%s"szMainszDetailszRegistered)
    }
    else
    {
        
server_print("^n%s%s^n%s"szMainszDetailszRegistered)
    }
}

public 
ServerCommand_LogEvents()
{
    new 
szArg1[6]
    
read_argv(1szArg15)

    static const 
szStates[][] = {"stop""print""log"}

    for(new 
ii<sizeof(szStates); i++)
    {
        if( 
equal(szArg1szStates[i]) && g_iState != )
        {
            
g_iState i
            
break
        }
    }

    
server_print("[LogEvents Logger] Currently : %s"szStates[g_iState])


When you are near the flag, type 'logevent log', wait for the thing be triggered, then type logevent stop, go in the log file and you will have an example on how you can register the logevent.

Maybe :
register_logevent("Cap_Flag", 4, "1=triggered a", "2=dod_capture_area")

Dr.G 02-11-2009 20:44

Re: Function istriggered is not configured in hamdata.ini.
 
ok thanks!


All times are GMT -4. The time now is 16:56.

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