Raised This Month: $32 Target: $400
 8% 

Solved [l4d2] - error creating acid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
weffer
Member
Join Date: Oct 2020
Old 10-10-2021 , 12:10   [l4d2] - error creating acid
Reply With Quote #1

Hello there :

I have problems creating acid in my position what is the error in the code or the signatures are wrong

---CODE
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define VERSION "1"

Handle g_hGameConf null;
Handle sdkDetonateAcid null;

public 
Plugin myinfo =
{
    
name "",
    
author "",
    
description "",
    
version VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_acid"Command_AcidADMFLAG_CHEATS"sm_acid");

    
g_hGameConf LoadGameConfigFile("l4d2_acid");
    if (
g_hGameConf == nullSetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
    
    
StartPrepSDKCall(SDKCall_Entity);
    
PrepSDKCall_SetFromConf(g_hGameConfSDKConf_Signature"CSpitterProjectile_Detonate");
    
sdkDetonateAcid EndPrepSDKCall();
    if (
sdkDetonateAcid == nullSetFailState("Unable to find the \"CSpitterProjectile::Detonate(void)\" signature, check the file version!");
}

public 
Action Command_Acid(int clientint args)
{
    if (!
client)
        return 
Plugin_Handled;    
    
    
CreateAcid(client);    
    
    return 
Plugin_Handled;
}

void CreateAcid(int client)
{
    
float vecPos[3];
    
GetClientAbsOrigin(clientvecPos);
    
vecPos[2]+=16.0;
    
    
int iAcid CreateEntityByName("spitter_projectile");
    if (
IsValidEntity(iAcid))
    {
        
LogMessage("valid");
        
TeleportEntity(iAcidvecPosNULL_VECTORNULL_VECTOR);
        
DispatchSpawn(iAcid);
        
        
SetEntPropFloat(iAcidProp_Send"m_DmgRadius"1024.0); 
        
SetEntProp(iAcidProp_Send"m_bIsLive"1);
        
SetEntPropEnt(iAcidProp_Send"m_hThrower"client);
        
        
SDKCall(sdkDetonateAcidiAcid);
    }



--Signatures
PHP Code:
"Games"
{
    
"left4dead2"
    
{
        
"Addresses"
        
{
            
"KnifePatch"
            
{
                
"windows"
                
{
                    
"signature"    "KnifePatch_Sig"            
                
}
                
"linux"
                
{
                    
"signature"    "KnifePatch_Sig"
                
}
            }
        }
        
"Signatures"
        
{
            
/*
            *    CSpitterProjectile::Detonate(void)
            *
            *  ->Search for string "spit_burst"
            */
            
"CSpitterProjectile_Detonate"
            
{
                
"library"    "server"
                "linux"        "@_ZN18CSpitterProjectile8DetonateEv"
                "windows"    "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\x2A\x89\x2A\x2A\x53\x8B\x2A\x57"
                        
/* ? ? ? ? ? ? ? ? ? A1 ? ? ? ? 33 ? 89 ? ? 53 8B ? 57 */
            
}
        }
    }


Last edited by weffer; 10-10-2021 at 22:25.
weffer is offline
Tonblader
Senior Member
Join Date: Jul 2011
Location: Peru
Old 10-10-2021 , 12:23   Re: [l4d2] - error creating acid
Reply With Quote #2

Maybe can see this:
[L4D2] Spitter Projectile Creator
Tonblader is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-10-2021 , 12:46   Re: [l4d2] - error creating acid
Reply With Quote #3

Left4DHooks added this native recently to create spitter projectiles.
__________________
Silvers is offline
weffer
Member
Join Date: Oct 2020
Old 10-10-2021 , 12:53   Re: [l4d2] - error creating acid
Reply With Quote #4

I understand you mean to create a spit projectile, but what I want is to create a puddle of acid in my position.
weffer is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-10-2021 , 13:09   Re: [l4d2] - error creating acid
Reply With Quote #5

Quote:
Originally Posted by weffer View Post
I understand you mean to create a spit projectile, but what I want is to create a puddle of acid in my position.
PHP Code:
GetClientAbsOrigin(clientvPos);
vPos[2] += 10.0
float vAng
[3];
vAng[2] = -100.0;
int projectile L4D_PipeBombPrj(clientvPosvAng); 
This will create the projectile and shoot it downwards. In next Left4DHooks version (1.63) coming soon, you could specify 0 instead of client when calling L4D_PipeBombPrj.

This will create the puddle. Maybe soon I'll add natives to Left4DHooks to create fire/fireworks/explosion/acid puddle instead of creating entities/projectiles to do this. For now this will work.
__________________
Silvers is offline
weffer
Member
Join Date: Oct 2020
Old 10-10-2021 , 15:56   Re: [l4d2] - error creating acid
Reply With Quote #6

Quote:
Originally Posted by Silvers View Post
PHP Code:
GetClientAbsOrigin(clientvPos);
vPos[2] += 10.0
float vAng
[3];
vAng[2] = -100.0;
int projectile L4D_PipeBombPrj(clientvPosvAng); 
This will create the projectile and shoot it downwards. In next Left4DHooks version (1.63) coming soon, you could specify 0 instead of client when calling L4D_PipeBombPrj.

This will create the puddle. Maybe soon I'll add natives to Left4DHooks to create fire/fireworks/explosion/acid puddle instead of creating entities/projectiles to do this. For now this will work.
hello silvers:
this function L4D_PipeBombPrj generates a pipe bomb, there is one to generate a puddle of acid
weffer is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 10-10-2021 , 17:41   Re: [l4d2] - error creating acid
Reply With Quote #7

You should use left4dhooks to spawn it.

Check this plugin: https://forums.alliedmods.net/showthread.php?p=2739386
I spawn an acid inside the spitter when it dies in one of the configs.
__________________
Marttt is offline
weffer
Member
Join Date: Oct 2020
Old 10-10-2021 , 18:41   Re: [l4d2] - error creating acid
Reply With Quote #8

Quote:
Originally Posted by weffer View Post
Hello there :

I have problems creating acid in my position what is the error in the code or the signatures are wrong

---CODE
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define VERSION "1"

Handle g_hGameConf null;
Handle sdkDetonateAcid null;

public 
Plugin myinfo =
{
    
name "",
    
author "",
    
description "",
    
version VERSION,
    
url ""
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_acid"Command_AcidADMFLAG_CHEATS"sm_acid");

    
g_hGameConf LoadGameConfigFile("l4d2_acid");
    if (
g_hGameConf == nullSetFailState("Couldn't find the offsets and signatures file. Please, check that it is installed correctly.");
    
    
StartPrepSDKCall(SDKCall_Entity);
    
PrepSDKCall_SetFromConf(g_hGameConfSDKConf_Signature"CSpitterProjectile_Detonate");
    
sdkDetonateAcid EndPrepSDKCall();
    if (
sdkDetonateAcid == nullSetFailState("Unable to find the \"CSpitterProjectile::Detonate(void)\" signature, check the file version!");
}

public 
Action Command_Acid(int clientint args)
{
    if (!
client)
        return 
Plugin_Handled;    
    
    
CreateAcid(client);    
    
    return 
Plugin_Handled;
}

void CreateAcid(int client)
{
    
float vecPos[3];
    
GetClientAbsOrigin(clientvecPos);
    
vecPos[2]+=16.0;
    
    
int iAcid CreateEntityByName("spitter_projectile");
    if (
IsValidEntity(iAcid))
    {
        
LogMessage("valid");
        
TeleportEntity(iAcidvecPosNULL_VECTORNULL_VECTOR);
        
DispatchSpawn(iAcid);
        
        
SetEntPropFloat(iAcidProp_Send"m_DmgRadius"1024.0); 
        
SetEntProp(iAcidProp_Send"m_bIsLive"1);
        
SetEntPropEnt(iAcidProp_Send"m_hThrower"client);
        
        
SDKCall(sdkDetonateAcidiAcid);
    }



--Signatures
PHP Code:
"Games"
{
    
"left4dead2"
    
{
        
"Addresses"
        
{
            
"KnifePatch"
            
{
                
"windows"
                
{
                    
"signature"    "KnifePatch_Sig"            
                
}
                
"linux"
                
{
                    
"signature"    "KnifePatch_Sig"
                
}
            }
        }
        
"Signatures"
        
{
            
/*
            *    CSpitterProjectile::Detonate(void)
            *
            *  ->Search for string "spit_burst"
            */
            
"CSpitterProjectile_Detonate"
            
{
                
"library"    "server"
                "linux"        "@_ZN18CSpitterProjectile8DetonateEv"
                "windows"    "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x33\x2A\x89\x2A\x2A\x53\x8B\x2A\x57"
                        
/* ? ? ? ? ? ? ? ? ? A1 ? ? ? ? 33 ? 89 ? ? 53 8B ? 57 */
            
}
        }
    }


I tried again with the code that I had put and actually if it works only that this for some reason works only when a special infected appears
weffer is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 10-10-2021 , 23:05   Re: [l4d2] - error creating acid
Reply With Quote #9

Ahh I meant to put "L4D2_VomitJarPrj" instead. The left4dhooks version doesn't require any special to be present afaik.
__________________
Silvers 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 18:00.


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