PDA

View Full Version : [REQ]no change name


donecant
06-08-2009, 00:08
I need a cs:s plugin.

The players cannot change name inside the game.

Thanks!
:oops:

strontiumdog
06-08-2009, 01:11
There is one plugin but it requires a MySQL connection.

http://forums.alliedmods.net/showthread.php?t=80909

donecant
06-08-2009, 01:21
:shock:oh no...This plug-in too big...

I need small & Simple ...

For example,(but it's AMX plugin)
#include<amxmodx>


public client_infochanged(id){
if (is_user_connected(id)){
new newname[32], oldname[32]
get_user_info(id, "name", newname,31)
get_user_name(id,oldname,31)
if (!equal(oldname,newname)){
client_print(id,print_chat,"** Changing name is not allowed here")
set_user_info(id,"name",oldname)
}
}
return PLUGIN_CONTINUE
}

public MessageNameChange(msgid, dest, receiver)
{
static info[64];
get_msg_arg_string(2, info, sizeof(info) - 1);

if( !equali(info, "#Cstrike_Name_Change") ) return PLUGIN_CONTINUE;

return PLUGIN_HANDLED;
}

public plugin_init() {
register_plugin("Dont change your name","1.0","Starsailor")
register_message(get_user_msgid("SayText"), "MessageNameChange");
}

thank strontiumdog:oops:

DJ Tsunami
06-10-2009, 11:53
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>

#define PL_VERSION "1.0"

public Plugin:myinfo =
{
name = "No Name Change",
author = "Tsunami",
description = "No Name Change",
version = PL_VERSION,
url = "http://www.tsunami-productions.nl"
}

new g_iMod;

public OnPluginStart()
{
g_iMod = GuessSDKVersion();

HookEvent("player_changename", Event_PlayerName);
}

public Action:Event_PlayerName(Handle:event, const String:name[], bool:dontBroadcast)
{
new iClient = GetClientOfUserId(GetEventInt(event, "userid"));

decl String:sName[MAX_NAME_LENGTH + 1];
GetEventString(event, "oldname", sName, sizeof(sName));

if(g_iMod > SOURCE_SDK_EPISODE1)
SetClientInfo(iClient, "name", sName);
else
ClientCommand(iClient, "name %s", sName);

return Plugin_Handled;
}

CS:S*
06-10-2009, 20:00
every time I try to load this plugin it gives me plenty of errors ,is this tetsted and working ?

L 06/11/2009 - 02:56:55: SourceMod error session started
L 06/11/2009 - 02:56:55: Info (map "zm_coliseum") (file "errors_20090611.log")
L 06/11/2009 - 02:56:55: [SM] Native "HookEvent" reported: Game event "player_changenanme" does not exist
L 06/11/2009 - 02:56:55: [SM] Displaying call stack trace for plugin "nonamechange.smx":
L 06/11/2009 - 02:56:55: [SM] [0] Line 23, nonamechange.sp::OnPluginStart()

Tsunami,could you pls make a working sp and attach it :wink:

psychonic
06-10-2009, 21:59
every time I try to load this plugin it gives me plenty of errors ,is this tetsted and working ?

L 06/11/2009 - 02:56:55: SourceMod error session started
L 06/11/2009 - 02:56:55: Info (map "zm_coliseum") (file "errors_20090611.log")
L 06/11/2009 - 02:56:55: [SM] Native "HookEvent" reported: Game event "player_changenanme" does not exist
L 06/11/2009 - 02:56:55: [SM] Displaying call stack trace for plugin "nonamechange.smx":
L 06/11/2009 - 02:56:55: [SM] [0] Line 23, nonamechange.sp::OnPluginStart()

Tsunami,could you pls make a working sp and attach it :wink:
It's just a typo. Change "player_changenanme" to "player_changename"

CS:S*
06-11-2009, 06:23
ok,now it's fine but I'm still able to change my name.What's wrong ?

No errors in the logs ... plugin is running :cry:

DJ Tsunami
06-11-2009, 06:27
Oops, sorry for the typo, fixed it in the post. I didn't test the code, but it seems fine to me, not sure why it doesn't work.

CS:S*
06-11-2009, 06:58
For CS:S doesn't work ... i don't run other games.I'm able to change my name with the plugin loaded ... so sad :|

maybe strontiumdog (https://forums.alliedmods.net/member.php?u=24573) can help,if he tell us how he did on his plugin ?

strontiumdog
06-11-2009, 10:25
Try this non-permanent version.
Their name will change back on map change but they shouldn't be able to change their name during the game.

If you want permanent then you need the MySQL version.

CS:S*
06-11-2009, 11:52
I'm still able to change my name with your plugin ... loaded,no errors,but it's not working properly.

Game "CS:S"

:cry:

strontiumdog
06-11-2009, 20:40
This version definitely works.
I tested it in CSS.

sm_pname <userid|name> "New Name"

Make sure you have the latest version of SM.
I wrote and tested this in v1.2.1

CS:S*
06-11-2009, 20:51
wiat a sec ... is this to set someone name ? i need the cmd console name command to be restricted .... (not in use ):)

i think we missunderstood ... i can still change my name in game ,i need to namechange to be restricted :shock::shock::shock:

Smashman
06-11-2009, 21:01
I think the OP is requesting, a plugin that disables clients from changing their names while connected to the server. Perhaps confusion occured.

CS:S*
06-11-2009, 21:18
Correct :)

strontiumdog
06-11-2009, 22:52
Ah...in that case, it's not possible.
'name' is a client command.

The only thing the server can do is change it and keep it changed.

bl4nk
06-12-2009, 00:09
It's possible, just not with a plugin. You need an extension to do it.

DJ Tsunami
06-12-2009, 06:39
Why is it not possible with a plugin? I figured hooking player_changename and then changing it back would work fine (ok, it's not really blocking name change, but it should change it back).

CS:S*
06-12-2009, 07:36
Yes but by the time you change it back amd i'm silenced I can tell you very nice words with my name.

The idea of this plugins is to block completely players from changing their names ingame because when they get silenced they start to abuse the admins with their names,and bad name ban plugin is stoping the players to get in with bad name ... so ... I hope u guys understood what I mean :wink:

DJ Tsunami
06-12-2009, 08:22
Yes, but my code blocks the event, so you shouldn't see that they're changing their name. But bl4nk is right, blocking is not possible without an extension, so you'll have to pay someone to make one for you.

CS:S*
06-12-2009, 08:23
yes ,bl4nk (https://forums.alliedmods.net/member.php?u=28850) will do it for me .... thank you anyway for your help :)

donecant
06-16-2009, 09:04
DJ Tsunami (http://forums.alliedmods.net/member.php?u=34668) is the right way.but ,When the user name is automatically modified, damn... Name change denied (rate exceeded),This rate no way to shut down...
damn...