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

gag on death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
VasqueS
Member
Join Date: Jan 2015
Old 11-15-2015 , 20:14   gag on death
Reply With Quote #1

I need a simple plugin that gag dead players and ungag when they respawn.
VasqueS is offline
tommie113
AlliedModders Donor
Join Date: Oct 2013
Old 11-15-2015 , 20:31   Re: gag on death
Reply With Quote #2

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);

__________________
No longer taking requests due to lack of time and interrest.
Only helping out with minor things through forum.
tommie113 is offline
VasqueS
Member
Join Date: Jan 2015
Old 11-15-2015 , 20:32   Re: gag on death
Reply With Quote #3

Thank you!
VasqueS is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-15-2015 , 21:22   Re: gag on death
Reply With Quote #4

Quote:
Originally Posted by tommie113 View Post
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
Drixevel is offline
tommie113
AlliedModders Donor
Join Date: Oct 2013
Old 11-16-2015 , 08:12   Re: gag on death
Reply With Quote #5

Quote:
Originally Posted by r3dw3r3w0lf View Post
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..
__________________
No longer taking requests due to lack of time and interrest.
Only helping out with minor things through forum.
tommie113 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 11-16-2015 , 19:27   Re: gag on death
Reply With Quote #6

Quote:
Originally Posted by tommie113 View Post
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.
Drixevel 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 17:35.


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