Raised This Month: $51 Target: $400
 12% 

Solved [L4D2] Spawn ghost infected players - Issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 09-13-2022 , 01:45   [L4D2] Spawn ghost infected players - Issue
Reply With Quote #1

Hello guys,

I have been trying to spawn dead infected into the spawnable ghost form, but with no luck

tried to manipulate with these EntProps but still:

PHP Code:
//SetEntProp(client, Prop_Send, "m_isGhost", 1);
//SetEntProp(client, Prop_Send,  "m_lifeState", 1);
//SetEntProp(client, Prop_Send, "m_ghostSpawnState", 0); 
This is the script

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

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
RegConsoleCmd("sm_boomer"Command_Boomer"Spawn as a boomer ghost");
}

public 
Action Command_Boomer(int clientint args)
{
    if (
GetClientTeam(client) == && !IsPlayerAlive(client))
    {
        
int CmdFlags GetCommandFlags("z_spawn_old");
        
SetCommandFlags("z_spawn_old"CmdFlags & ~FCVAR_CHEAT);
        
FakeClientCommand(client"z_spawn_old boomer auto");
    }
    else 
PrintToChat(client"only dead infected can use this command");

__________________

Last edited by alasfourom; 09-14-2022 at 01:59.
alasfourom is offline
sorallll
Senior Member
Join Date: Oct 2018
Old 09-13-2022 , 02:17   Re: [L4D2] Spawn ghost infected players - Issue
Reply With Quote #2

PHP Code:
Handle g_hSDK_CTerrorPlayer_SetPreSpawnClassg_hSDK_CCSPlayer_State_Transition;

char sPath[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMsPathsizeof sPath"gamedata/%s.txt"GAMEDATA);
    if (!
FileExists(sPath))
        
SetFailState("\n==========\nMissing required file: \"%s\".\n=========="sPath);

    
GameData hGameData = new GameData(GAMEDATA);
    if (!
hGameData)
        
SetFailState("Failed to load \"%s.txt\" gamedata."GAMEDATA);

StartPrepSDKCall(SDKCall_Player);
    if (!
PrepSDKCall_SetFromConf(hGameDataSDKConf_Signature"CTerrorPlayer::SetPreSpawnClass"))
        
SetFailState("Failed to find signature: \"CTerrorPlayer::SetPreSpawnClass\"");
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
g_hSDK_CTerrorPlayer_SetPreSpawnClass EndPrepSDKCall();
    if (!
g_hSDK_CTerrorPlayer_SetPreSpawnClass)
        
SetFailState("Failed to create SDKCall: \"CTerrorPlayer::SetPreSpawnClass\"");

StartPrepSDKCall(SDKCall_Player);
    if (!
PrepSDKCall_SetFromConf(hGameDataSDKConf_Signature"CCSPlayer::State_Transition"))
        
SetFailState("Failed to find signature: \"CCSPlayer::State_Transition\"");
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
g_hSDK_CCSPlayer_State_Transition EndPrepSDKCall();
    if (!
g_hSDK_CCSPlayer_State_Transition)
        
SetFailState("Failed to create SDKCall: \"CCSPlayer::State_Transition\""); 
PHP Code:
// CTerrorPlayer::UpdateZombieFrustration(CTerrorPlayer *__hidden this)
SDKCall(g_hSDK_CTerrorPlayer_SetPreSpawnClassclient3);
SDKCall(g_hSDK_CCSPlayer_State_Transitionclient8); 
PHP Code:
/* CTerrorPlayer::SetPreSpawnClass(ZombieClassType) */
            
"CTerrorPlayer::SetPreSpawnClass"
            
{
                
"library"    "server"
                "linux"        "@_ZN13CTerrorPlayer16SetPreSpawnClassE15ZombieClassType"
                "windows"    "\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x2A\x39\xBE\xB8"
                
/* ? ? ? ? ? ? ? ? 8B ? 39 BE B8 */
            
}

/* CCSPlayer::State_Transition(CSPlayerState) */
            
"CCSPlayer::State_Transition"
            
{
                
"library"    "server"
                "linux"        "@_ZN9CCSPlayer16State_TransitionE13CSPlayerState"
                "windows"    "\x2A\x2A\x2A\x2A\x2A\x2A\x8B\x86\x2A\x2A\x2A\x2A\x57\x8B\x2A\x2A\x85\x2A\x74\x2A\x83"
                
/* ? ? ? ? ? ? 8B 86 ? ? ? ? 57 8B ? ? 85 ? 74 ? 83 */
            


Last edited by sorallll; 09-13-2022 at 02:24.
sorallll is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 09-13-2022 , 04:40   Re: [L4D2] Spawn ghost infected players - Issue
Reply With Quote #3

Thank you for your replay,

I ended up using left4dhooks

PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>
#include <left4dhooks>

#pragma semicolon 1
#pragma newdecls required

public void OnPluginStart()
{
    
RegConsoleCmd("sm_boomer"Command_Boomer"Spawn as a boomer ghost");
}

public 
Action Command_Boomer(int clientint args)
{
    if (
GetClientTeam(client) == && !IsPlayerAlive(client))
    {
        
L4D_State_Transition(clientSTATE_GHOST);
        
L4D_SetClass(client2); //2 = Boomer
    
}
    else 
PrintToChat(client"only dead infected can use this command");

__________________
alasfourom 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 17:05.


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