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

Does anyone know the code that prevents passing deceased players to the spectator tea


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Darkwob
BANNED
Join Date: Oct 2018
Old 05-19-2021 , 15:11   Does anyone know the code that prevents passing deceased players to the spectator tea
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
sorallll
Senior Member
Join Date: Oct 2018
Old 05-20-2021 , 13:56   Re: Does anyone know the code that prevents passing deceased players to the spectator
Reply With Quote #2

PHP Code:
// ------------------------------------------------------------------------
// When player dies, forces takeover of the bot
// ------------------------------------------------------------------------
public Action Event_PlayerDeath(Handle event, const char[] namebool dontBroadcast)
{
    
// Event is triggered when a player dies
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
TakeOver(client);
}

void TakeOver(int bot)
{
    if(
bot && IsClientInGame(bot) &&  IsFakeClient(bot) && GetClientTeam(bot) == TEAM_SURVIVOR && GetIdlePlayer(bot))
    {
        
int idleplayer GetIdlePlayer(bot);
        
SetHumanIdle(botidleplayer);
        
TakeOverBot(idleplayer);        
    }

https://forums.alliedmods.net/showpo...postcount=1064
sorallll is offline
Darkwob
BANNED
Join Date: Oct 2018
Old 05-20-2021 , 19:50   Re: Does anyone know the code that prevents passing deceased players to the spectator
Reply With Quote #3

Quote:
Originally Posted by sorallll View Post
PHP Code:
// ------------------------------------------------------------------------
// When player dies, forces takeover of the bot
// ------------------------------------------------------------------------
public Action Event_PlayerDeath(Handle event, const char[] namebool dontBroadcast)
{
    
// Event is triggered when a player dies
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
TakeOver(client);
}

void TakeOver(int bot)
{
    if(
bot && IsClientInGame(bot) &&  IsFakeClient(bot) && GetClientTeam(bot) == TEAM_SURVIVOR && GetIdlePlayer(bot))
    {
        
int idleplayer GetIdlePlayer(bot);
        
SetHumanIdle(botidleplayer);
        
TakeOverBot(idleplayer);        
    }

https://forums.alliedmods.net/showpo...postcount=1064
doesnt work bro.
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 01:14.


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