Raised This Month: $ Target: $400
 0% 

I need Author's to have a look?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 05-23-2021 , 17:16   I need Author's to have a look?
Reply With Quote #1

I have an afk manager plug-in that I tried to recompile, and I realized that the deceased players could pass on to the audience team. I think this will ruin a fair gaming experience within the game. Can anyone help me with this? I want to prevent the deceased player from passing to the spectator team.


I forgot to write this. After the player dies, he must not switch to the spectator team using the! idle command. Anyway, if I think any other plugin, it will not be passed on to the audience team.

PHP Code:
HookEvent("player_death"Event_PlayerDeathEventHookMode_Post); //I guess we define it first.
 

public Action:Player_death(clientargs)
{
I don't know what should be written here.

Darkwob is offline
Et3rnity
Member
Join Date: Sep 2018
Location: Romania
Old 05-24-2021 , 02:44   Re: I need Author's to have a look?
Reply With Quote #2

Post all code.
__________________
Et3rnity is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 05-24-2021 , 06:12   Re: I need Author's to have a look?
Reply With Quote #3

Quote:
Originally Posted by Et3rnity View Post
Post all code.
PLUGİN SOURCE CODE
Darkwob is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 05-24-2021 , 08:56   Re: I need Author's to have a look?
Reply With Quote #4

Quote:
Originally Posted by Darkwob View Post
The command should no longer work if the player is dead.

line: 324
Code:
public Action:Idle(client, args)
{

	if (GetClientTeam(client) != 1)
	{
		ChangeClientTeam(client, 1);
		ForcePlayerSuicide(client);
		PrintToChatAll("\x04[\x05AFK Manager\x04]\x01 Player \x04'%N'\x01 has moved to Spectator team (!idle).", client);
                PrintToServer("[AFK Manager] Player '%N' has moved to Spectator team (!idle).", client);
	}
-->

Code:
public Action Idle(int client, int args)
{
	
	if (GetClientTeam(client) != 1)
	{
		if (IsPlayerAlive(client))
		{
			ChangeClientTeam(client, 1);
			ForcePlayerSuicide(client);
			PrintToChatAll("\x04[\x05AFK Manager\x04]\x01 Player \x04'%N'\x01 has moved to Spectator team (!idle).", client);
			PrintToServer("[AFK Manager] Player '%N' has moved to Spectator team (!idle).", client);
		}
		else
		{
			PrintToChat(client, "[AFK Manager] You cannot use the !idle command while dead.", client);
		}
	}
}
Attached Files
File Type: sp Get Plugin or Get Source (l4d2_afk__fix.sp - 57 views - 10.1 KB)

Last edited by Sreaper; 05-24-2021 at 09:00.
Sreaper is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 05-24-2021 , 17:37   Re: I need Author's to have a look?
Reply With Quote #5

Quote:
Originally Posted by Sreaper View Post
The command should no longer work if the player is dead.

line: 324
Code:
public Action:Idle(client, args)
{

	if (GetClientTeam(client) != 1)
	{
		ChangeClientTeam(client, 1);
		ForcePlayerSuicide(client);
		PrintToChatAll("\x04[\x05AFK Manager\x04]\x01 Player \x04'%N'\x01 has moved to Spectator team (!idle).", client);
                PrintToServer("[AFK Manager] Player '%N' has moved to Spectator team (!idle).", client);
	}
-->

Code:
public Action Idle(int client, int args)
{
	
	if (GetClientTeam(client) != 1)
	{
		if (IsPlayerAlive(client))
		{
			ChangeClientTeam(client, 1);
			ForcePlayerSuicide(client);
			PrintToChatAll("\x04[\x05AFK Manager\x04]\x01 Player \x04'%N'\x01 has moved to Spectator team (!idle).", client);
			PrintToServer("[AFK Manager] Player '%N' has moved to Spectator team (!idle).", client);
		}
		else
		{
			PrintToChat(client, "[AFK Manager] You cannot use the !idle command while dead.", client);
		}
	}
}
but we don't check if the player is dead? If the player is alive when using the command not to cause problems?

adding: did not work. As I said, we need to check if the client is alive or dead first, but I don't know.

Last edited by Darkwob; 05-24-2021 at 18:21.
Darkwob is offline
Et3rnity
Member
Join Date: Sep 2018
Location: Romania
Old 05-25-2021 , 10:41   Re: I need Author's to have a look?
Reply With Quote #6

But the client can`t use the command now if he is dead.
__________________

Last edited by Et3rnity; 05-25-2021 at 11:24.
Et3rnity is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 05-25-2021 , 17:09   Re: I need Author's to have a look?
Reply With Quote #7

Quote:
Originally Posted by Et3rnity View Post
But the client can`t use the command now if he is dead.
can be used. It can switch to the spectator team with the client idle command.

Last edited by Darkwob; 05-25-2021 at 17:10.
Darkwob 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 13:30.


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