AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   gag on death (https://forums.alliedmods.net/showthread.php?t=274841)

VasqueS 11-15-2015 20:14

gag on death
 
I need a simple plugin that gag dead players and ungag when they respawn.

tommie113 11-15-2015 20:31

Re: gag on death
 
Very simple plugin purely based on what you said.
Will gag on death, ungag on spawn.
Does not take gagged people (by other plugins/admins) into account with gagging/ungagging.

PHP Code:

#include <sourcemod>

public OnPluginStart()
{
    
HookEvent("player_death"OnPlayerDeath);
    
HookEvent("player_spawn"OnPlayerSpawn);
}

public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    
int userid;
    
userid GetEventInt(event"userid");
    
    
int client;
    
client GetClientOfUserId(userid);
    
    
ServerCommand("sm_gag %i"client);
}

public 
Action:OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    
int userid;
    
userid GetEventInt(event"userid");
    
    
int client;
    
client GetClientOfUserId(userid);
    
    
ServerCommand("sm_ungag %i"client);



VasqueS 11-15-2015 20:32

Re: gag on death
 
Thank you!

Drixevel 11-15-2015 21:22

Re: gag on death
 
Quote:

Originally Posted by tommie113 (Post 2363567)
Very simple plugin purely based on what you said.
Will gag on death, ungag on spawn.
Does not take gagged people (by other plugins/admins) into account with gagging/ungagging.

PHP Code:

#include <sourcemod>

public OnPluginStart()
{
    
HookEvent("player_death"OnPlayerDeath);
    
HookEvent("player_spawn"OnPlayerSpawn);
}

public 
Action:OnPlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    
int userid;
    
userid GetEventInt(event"userid");
    
    
int client;
    
client GetClientOfUserId(userid);
    
    
ServerCommand("sm_gag %i"client);
}

public 
Action:OnPlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    
int userid;
    
userid GetEventInt(event"userid");
    
    
int client;
    
client GetClientOfUserId(userid);
    
    
ServerCommand("sm_ungag %i"client);



https://sm.alliedmods.net/new-api/ba..._SetClientMute

tommie113 11-16-2015 08:12

Re: gag on death
 
Quote:

Originally Posted by r3dw3r3w0lf (Post 2363580)

I think you mean https://sm.alliedmods.net/new-api/ba...m_SetClientGag
However the basecomm natives did not work for me last time I tried to use them.
See: https://forums.alliedmods.net/showthread.php?t=274439
But noone even bothers to help out with it..

Drixevel 11-16-2015 19:27

Re: gag on death
 
Quote:

Originally Posted by tommie113 (Post 2363644)
I think you mean https://sm.alliedmods.net/new-api/ba...m_SetClientGag
However the basecomm natives did not work for me last time I tried to use them.
See: https://forums.alliedmods.net/showthread.php?t=274439
But noone even bothers to help out with it..

Yes, yes and It works fine for me when I use it.


All times are GMT -4. The time now is 05:55.

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