View Single Post
dustinandband
Senior Member
Join Date: May 2015
Old 09-15-2018 , 13:02   Re: Name change kicker
Reply With Quote #2

Lemme know if this compiles / works. Copied some code on my iPhone since I’m unable to get to pc for a few days

PHP Code:
#include <sourcemod>

public Plugin myinfo =
{
    
name "Name Change kicker",
    
author "dustin",
    
description "",
    
version "1.0",
    
url "",
};

public 
OnPluginStart()
{
    
HookEvent("player_changename"Event_OnNameChange);
}

public 
Action:Event_OnNameChange(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    if (!
IsClientInGame(client) || IsFakeClient(client)) return Plugin_Handled;
    
    
KickClient(client, &#8220;name changes aren’t allowed.”);
    
return Plugin_Handled;

Edit: the symbols after KickClient(client, - should be a quotation mark
No idea why it did that

Last edited by dustinandband; 09-15-2018 at 13:06.
dustinandband is offline