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

Solved [L4D] How to force mission lost


Post New Thread Reply   
 
Thread Tools Display Modes
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-19-2022 , 09:35   Re: [L4D] How to force mission lost
Reply With Quote #31

The final: https://forums.alliedmods.net/showpo...9&postcount=19
But not the ideal.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 04-29-2022 , 16:36   Re: [L4D] How to force mission lost
Reply With Quote #32

Quote:
Originally Posted by Dragokas View Post
I:\!L4D\test\1.sp(61) : error 092: number of arguments does not match definition
I:\!L4D\test\1.sp(29) : warning 203: symbol is never used: "GameOver"
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-29-2022 , 16:40   Re: [L4D] How to force mission lost
Reply With Quote #33

Quote:
Originally Posted by ZBzibing View Post
I'm looking for this functionality, can anyone release this plugin. Or give an example to directly end the current game round with a single command, like endround
Strip cheat flags (if there are any) and execute "endround" command (then re-apply cheat flags)?
__________________
Silvers is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 04-30-2022 , 08:50   Re: [L4D] How to force mission lost
Reply With Quote #34

Quote:
Originally Posted by Silvers View Post
Strip cheat flags (if there are any) and execute "endround" command (then re-apply cheat flags)?
HTML Code:
int oldFlags = GetCommandFlags("endround");
	SetCommandFlags("endround", oldFlags & ~(FCVAR_CHEAT));
	ServerCommand("endround");
	//ServerExecute("endround");
	SetCommandFlags("endround", oldFlags);
Tried it, it doesn't seem to work
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-30-2022 , 13:45   Re: [L4D] How to force mission lost
Reply With Quote #35

Quote:
Originally Posted by ZBzibing View Post
HTML Code:
int oldFlags = GetCommandFlags("endround");
	SetCommandFlags("endround", oldFlags & ~(FCVAR_CHEAT));
	ServerCommand("endround");
	//ServerExecute("endround");
	SetCommandFlags("endround", oldFlags);
Tried it, it doesn't seem to work
The main key is "delay"


Admin command: sm_cheatcmd
sm_cheatcmd endround
PHP Code:


public void OnPluginStart()
{
    
RegAdminCmd("sm_cheatcmd"cmdADMFLAG_CHEATS"Try execute cheat command from server console input");
}

public 
Action cmd(int clientint args)
{
    
char command[100];
    
GetCmdArg(1commandsizeof(command));

    if(!
CommandExists(command))
    {
        
ReplyToCommand(client"[SM] Unable to find cmd: %s"command);
        return 
Plugin_Handled;        
    }

    
int flags GetCommandFlags(command);

    
int newflags flags;
    
newflags &= ~FCVAR_CHEAT;

    if(!
SetCommandFlags(commandnewflags))
    {
        
ReplyToCommand(client"[SM] Failed to set flag(s) to command %s"command);
        return 
Plugin_Handled;
    }

    
char commandinput[128];

    
GetCmdArgString(commandinputsizeof(commandinput));

    
DataPack pack = new DataPack();
    
pack.WriteCell(flags);
    
pack.WriteString(command);
    
pack.WriteString(commandinput);

    
RequestFrame(delay_servercommandpack);

    return 
Plugin_Handled;
}

public 
void delay_servercommand(DataPack pack)
{
    
pack.Reset();
    
int flags pack.ReadCell();
    
    
char command[100];
    
pack.ReadString(commandsizeof(command));
    
    
char commandinput[128];
    
pack.ReadString(commandinputsizeof(commandinput));
    
delete pack;

    
ServerCommand("%s"commandinput);

    
DataPack newpack = new DataPack();

    
newpack.WriteCell(flags);
    
newpack.WriteString(command);
    
RequestFrame(delay_setflagsnewpack);


}

public 
void delay_setflags(DataPack pack)
{
    
pack.Reset();
    
int flags pack.ReadCell();
    
    
char command[100];
    
pack.ReadString(commandsizeof(command));
    
delete pack;

    
SetCommandFlags(commandflags);

command endround restart round.
Same as sm_cvar mp_restartgame 1
__________________
Do not Private Message @me

Last edited by Bacardi; 04-30-2022 at 13:46.
Bacardi is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 05-05-2022 , 11:15   Re: [L4D] How to force mission lost
Reply With Quote #36

Quote:
Originally Posted by Bacardi View Post
The main key is "delay"
Admin command: sm_cheatcmd
sm_cheatcmd endround
command endround restart round.
Same as sm_cvar mp_restartgame 1
After testing, it works normally.
Can I use this command to execute other statements?
Example: !cheatcmd z_spawn mob
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-05-2022 , 13:53   Re: [L4D] How to force mission lost
Reply With Quote #37

It is for commands.

Use sm_cvar
__________________
Do not Private Message @me
Bacardi is offline
ZBzibing
Senior Member
Join Date: Dec 2012
Old 05-06-2022 , 05:18   Re: [L4D] How to force mission lost
Reply With Quote #38

Quote:
Originally Posted by Bacardi View Post
It is for commands.
Use sm_cvar
I think he can run some other commands, tried a few to no avail, but the endround can only run successfully, thank you very much
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1:
ZBzibing is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-05-2023 , 04:18   Re: [L4D] How to force mission lost
Reply With Quote #39

It might work if you FakeClientCommand on scenario_end. It works when I put it in console.
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Reply


Thread Tools
Display Modes

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 09:55.


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