AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Name Changer Notify Help (https://forums.alliedmods.net/showthread.php?t=83885)

Akhil 01-17-2009 01:43

Name Changer Notify Help
 
Hi guys i'm making a plugin which helps to identify the player whos changing the server's name.Ive made plugin by looking at parts of other plugins' source
Forget Optimising the plugin isnt even working.
I dont know whats the problem.
Plzz help me
Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Name Change Detector"
#define VERSION "1.0"
#define AUTHOR "Akhil"

// constants
new const NAME_ADMIN = ADMIN_ALL

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR);
   
    // command to detect name change
    register_clcmd("cmd", "nameChange");
}

public nameChange(id)
{
    if(get_user_flags(id)==NAME_ADMIN)
    return PLUGIN_HANDLED;
   
    new command[5];
   
    read_argv(1, command, 4); //read command from the user
   
    if(equali(command, "name")) // whether given command after cmd is name?
    {
        set_hudmessage(255, 127, 42, 0.5, -1.0, 0, 6.0, 7.0);
        show_hudmessage(0, "%s has changed the name And he's a Big Noob", id);
        show_hudmessage(0, "%s YOU WEAK PATHETIC FOOL!!!!!", id);
    }
    return PLUGIN_HANDLED;
}

This is the code
And it would help if i could add a sound that would play when it prints the message on the hud
like you are a noob.
So plzz help how to play a custom sound at that time.

Akhil 01-17-2009 05:43

Re: Name Changer Notify Help
 
I think the command is not even registering.
I tried a lot of things clcmd concmd and also removed the flags thingy
still no use
has the clcmd have any restrictions on the commands to be used

PLz help

SnoW 01-17-2009 06:02

Re: Name Changer Notify Help
 
Ye, the name command isn't sent to server. Still you are allowed to get user name with get_user_name, so just figure out something else with it. :)

GoGoGo 01-17-2009 06:27

Re: Name Changer Notify Help
 
PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define msc "misc/noob.wav"

#define PLUGIN "Name Change Detector"
#define VERSION "1.0"
#define AUTHOR "Akhil"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

}

public  
client_infochanged id 
{
    if(
get_user_flagsid ) == ADMIN_ALL)
    return 
PLUGIN_HANDLED

    new 
name[32]
    
get_user_name (idname31)
    
set_hudmessage(255127420.5, -1.006.07.0);
    
show_hudmessage(0"%s has changed the name And he's a Big Noob"namename); // what a stupid plugin : ( 
    
client_print(id,print_chat,"%s YOU WEAK PATHETIC FOOL!!!!!",name)
    
    
//read about hud's channels if you don't want to print @UP message to player :)
    
    
client_cmd(id,"spk %s"msc)
    
    return 
PLUGIN_HANDLED;
}
public 
plugin_precache()
{
    
precache_soundmsc )    


And don't bump topics (!)

ConnorMcLeod 01-17-2009 07:07

Re: Name Changer Notify Help
 
Why don't you run a dedicated server instead of a listenserver ?

GoGoGo 01-17-2009 09:14

Re: Name Changer Notify Help
 
Conor are you asking me?

Listen is faster to turn on.

Akhil 01-17-2009 14:07

Re: Name Changer Notify Help
 
Quote:

Originally Posted by SnoW (Post 745622)
Ye, the name command isn't sent to server. Still you are allowed to get user name with get_user_name, so just figure out something else with it. :)

Even I tried to change my name with that cmd name command but still its not working. And i tried it after removing the cmd_access part.At least my command would reach the server no?

Quote:

Originally Posted by GoGoGo (Post 745631)
// what a stupid plugin : (
And don't bump topics (!)

I dont think u got my point friend.
I want to detect the player who is trying to change name of the server(admin)
and not his own
and i think thats what ur program does
Correct me if I am wrong

And i am really sorry if I am being a noob for making useless topics but i had seen some1 request for a plugin like this thats why i attempted it.

@Connor
My dedicated server always lags and many times not even visible in server list
And also it would me nice to catch the culprit red handed

$gogogo

I tested ur plugin and it detect name change of only himself.
It doesnt detect if a plyer is changing admin's name.
And also the sounds and hud message comes twice
once after loading map and once after entering a team in case of ur plugin.


PS: i want the sound to play to every1

fysiks 01-19-2009 02:21

Re: Name Changer Notify Help
 
Are you wanting to find a registered admin that is changing the server's name? Or are you looking for someone that shouldn't have this access?

I think if you turn on logging you can look through the logs and find if someone with admin is changing it via amxmodx. Probably with: "amx_cvar hostname newservername".

Or, if this is being done maliciously through rcon I suggest you change your rcon password.

Akhil 01-19-2009 03:37

Re: Name Changer Notify Help
 
Quote:

Originally Posted by fysiks (Post 746588)
I think if you turn on logging you can look through the logs and find if someone with admin is changing it via amxmodx. Probably with: "amx_cvar hostname newservername".

I am the only admin of my server.

Quote:

Originally Posted by fysiks (Post 746588)
Or, if this is being done maliciously through rcon I suggest you change your rcon password.

Ya not actually mliciously. I am running a a listen server and not HLDS
so the players can change my name with a command
cmd name <Req. name>.
This is exactly what i want to catch

fysiks 01-20-2009 16:31

Re: Name Changer Notify Help
 
Quote:

Originally Posted by Akhil (Post 746607)
. . . so the players can change my name with a command
cmd name <Req. name>.
This is exactly what i want to catch

You speak of someone changing your player name here but before you say someone changes the server's name? Which one is it?

As far as I know, another can't change your player name without admin regardless of it being a listen server. For that matter, you can't change the server's name without admin anyways.


All times are GMT -4. The time now is 01:54.

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