Raised This Month: $ Target: $400
 0% 

Simulating UTIL_LogPrintf


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-22-2017 , 11:10   Re: Simulating UTIL_LogPrintf
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <orpheu>
#include <fakemeta>

#pragma ctrlchar '\'

new OrpheuFunction:HandleC_AlertMessage

public plugin_init()
{
    
register_logevent("OnLogEvent_RoundEnd"2"1=Round_End")  
    
register_srvcmd("test""ServerCommand_Test")
    
    
HandleC_AlertMessage OrpheuGetFunction("C_AlertMessage")
}

public 
ServerCommand_Test()
{
    
OrpheuCall(HandleC_AlertMessageat_logged"World triggered \"Round_End\"\n")
}

public 
OnLogEvent_RoundEnd()
{
    
server_print("OnLogEvent_RoundEnd called")

Code:
{
    "name"      : "C_AlertMessage",
    "library"   : "amxmodx_mm",
    "arguments" :
    [
        {
            "type"  : "int"
        },
        {
            "type"  : "char *"
        }
    ],
    "identifiers":
    [
        {
            "os"    : "windows",
            "mod"   : "cstrike",
            "value" : [0x83,"*","*","*","*",0x74,"*",0xA1,"*","*","*","*",0xC7,"*","*","*","*","*",0xC3,0x80]
        },
        {
            "os"    : "linux",
            "mod"   : "cstrike",
            "value" : [0x83,"*","*",0x83,"*","*","*","*",0x74,"*",0xA1]
        }
    ]
}
Reference: https://github.com/alliedmodders/amx..._api.cpp#L1457

Write "test" in the server console, the log event will be called.
__________________

Last edited by HamletEagle; 07-22-2017 at 11:15.
HamletEagle 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:46.


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