Raised This Month: $ Target: $400
 0% 

Sig Scanning Problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LionElJonson
Junior Member
Join Date: Oct 2007
Old 10-23-2007 , 23:20   Sig Scanning Problems
Reply With Quote #1

When I compile the following code, the SignatureScanCall() function call causes a warning; Says tag mismatch. I'm clueless wtf is wrong...any ideas would be much appreciated.

Code:
#include <sourcemod>
#include <sdktools>
#include <core>
#include <sigoffset>

new bloodspray_index;

public OnPluginStart()
{
    HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}

public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    bloodspray_index = SignatureScanFind("UTIL_BloodSpray","\x8b\x4c\x24\x0c\x83\xec\x60\x83\xf9\xff\x0f\x84\xa7\x00\x00\x00\x33\xc0\xdb\x44\x24\x70\x89\x44\x24\x34\x89\x44\x24\x44\x66\x89\x44\x24\x48\xd9\x5c\x24\x38\x89\x44\x24\x3c\x89\x44\x24\x40\x89\x44\x24\x4c","xxxxxxxxxx??????xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",51,"_Z15UTIL_BloodSprayRK6VectorS1_iii");

    new client = GetClientOfUserId(GetEventInt(event, "userid"));

    new Float:origin[3];
    new Float:dest[3];
    
    GetClientAbsOrigin(client, origin);
    
    dest[0] = origin[0] + 10.0;
    dest[1] = origin[1] + 10.0;
    dest[2] = origin[2] + 10.0;
  
    new attackerId = GetEventInt(event, "attacker");
    
    decl String:weapon[64];
    GetEventString(event, "weapon", weapon, sizeof(weapon));
    
    new headshotId = GetEventInt(event, "customkill");
    
    new attacker = GetClientOfUserId(attackerId);
    decl String:atname[64];
    GetClientName(attacker, atname, sizeof(atname));
    
    if(GetEventInt(event, "customkill") == 1)
    {
       SignatureScanCall(bloodspray_index, PARAM_CBASEENTITY, client, PARAM_VECTOR, origin, PARAM_VECTOR, dest, PARAM_INT, 247, PARAM_INT, 255, PARAM_INT, 6);
        
    }
       
      return Plugin_Continue;
}
LionElJonson is offline
BAILOPAN
Join Date: Jan 2004
Old 10-24-2007 , 03:58   Re: Sig Scanning Problems
Reply With Quote #2

That doesn't look like a function from our API. I suggest you use SDKTools, which is our official interface for this type of thing. It also lets you abstract signatures into nice config files.

You can paste the SignatureScanCall() declaration here if you'd like, but I won't be able to explain anything other than why the tag mismatch occurs.
__________________
egg
BAILOPAN is offline
LionElJonson
Junior Member
Join Date: Oct 2007
Old 10-24-2007 , 14:28   Re: Sig Scanning Problems
Reply With Quote #3

So like this?

Code:
#include <sourcemod>
#include <sdktools>

new Handle:hGameConf;
new Handle:hBloodSpray;

public OnPluginStart()
{
    hGameConf = LoadGameConfigFile("gib-tf.games.txt");
    StartPrepSDKCall(SDKCall_Player);
    PrepSDKCall_SetFromConf(hGameConf, SDKConf_Signature, "UTIL_BloodSpray");
    PrepSDKCall_AddParameter(SDKType_Vector,SDKPass_Plain);
    PrepSDKCall_AddParameter(SDKType_Vector,SDKPass_Plain);
    PrepSDKCall_AddParameter(SDKType_PlainOldData,SDKPass_Plain);
    PrepSDKCall_AddParameter(SDKType_PlainOldData,SDKPass_Plain);
    PrepSDKCall_AddParameter(SDKType_PlainOldData,SDKPass_Plain);
    hBloodSpray = EndPrepSDKCall();
    
    HookEvent("player_death", Event_PlayerDeath, EventHookMode_Pre);
}

public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));

    new Float:origin[3];
    new Float:dest[3];
    
    GetClientAbsOrigin(client, origin);
    
    dest[0] = origin[0] + 10.0;
    dest[1] = origin[1] + 10.0;
    dest[2] = origin[2] + 10.0;
  
    new attackerId = GetEventInt(event, "attacker");
    
    decl String:weapon[64];
    GetEventString(event, "weapon", weapon, sizeof(weapon));
    
    new headshotId = GetEventInt(event, "customkill");
    
    new attacker = GetClientOfUserId(attackerId);
    decl String:atname[64];
    GetClientName(attacker, atname, sizeof(atname));
    
    if(GetEventInt(event, "customkill") == 1)
    {
     SDKCall(hBloodSpray, client, origin, dest, 247, 255, 6);
    }
       
    PrintToConsole(client,
    "You should have gibbed by \"%s\" (weapon \"%s\") (headshot \"%d\")",
    atname,
    weapon,
    headshotId);
    PrintToConsole(attacker,
    "You should have gibbed by \"%s\" (weapon \"%s\") (headshot \"%d\")",
    atname,
    weapon,
    headshotId);        
    
    return Plugin_Continue;
}
Code:
"Games"
{
    "tf"
    {
        "Signatures"
        {
            "UTIL_BloodSpray"
            {
                "library"    "server"
                "windows"    "\x8b\x4c\x24\x0c\x83\xec\x60\x83\xf9\xff\x0f\x84\xa7\x00\x00\x00\x33\xc0\xdb\x44\x24\x70\x89\x44\x24\x34\x89\x44\x24\x44\x66\x89\x44\x24\x48\xd9\x5c\x24\x38\x89\x44\x24\x3c\x89\x44\x24\x40\x89\x44\x24\x4c"
                "linux"        "_Z15UTIL_BloodSprayRK6VectorS1_iii"
            }
        }
    }
}
LionElJonson 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 23:38.


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