Raised This Month: $ Target: $400
 0% 

Name Chooser


Post New Thread Reply   
 
Thread Tools Display Modes
meigyoku
BANNED
Join Date: Apr 2009
Old 09-09-2009 , 16:04   Re: Name Chooser
Reply With Quote #21

Thank pizzahut! I will try!
meigyoku is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 09-11-2009 , 12:33   Re: Name Chooser
Reply With Quote #22

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

new enabled

public plugin_init() {
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
RegisterHamHam_Spawn"player""client_spawn")
    
    
enabled register_cvar"amx_namechanger""1" )
}

public 
client_spawnid 
{
    if( 
is_user_aliveid ) && get_pcvar_numenabled ) )
    {
        static 
name[33]
        
get_user_name(idnamesizeof name 1)
        
        if( 
equalname"Player" ) || equalname"empty" ) )
        {
            
client_cmdid"messagemode name" )
            
client_printidprint_chat"Please type NOW your new name and press [Enter]" )
            
set_hudmessage255255255, -1.0, -1.004.08.01.02.0, -)
            
show_hudmessageid"Please type NOW your new name and press [Enter]" )            
        }        
    }    
}

public 
client_infochangedid 
{
    
client_spawnid )

__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-12-2009 , 07:35   Re: Name Chooser
Reply With Quote #23

Good work, Sn!ff3r. I wonder, does your plugin also work if there are several people with the name of "Player" at the same time ("Player", "(1)Player", "(2)Player" etc.)? Over time catching only the first one is sufficient, however on the server where it's used we had tons of people with this name (more than 10) so I wanted the plugin to have an immediate effect on most of them. I thought about using a regular expression module but decided it was a bit of an overkill.
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.
pizzahut is offline
TazZ.amxx
Member
Join Date: Jun 2009
Old 09-12-2009 , 11:10   Re: Name Chooser
Reply With Quote #24

is there a difference to the plugin of the first post?
Quote:
Originally Posted by Sn!ff3r View Post
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

new enabled

public plugin_init() {
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
RegisterHamHam_Spawn"player""client_spawn")
    
    
enabled register_cvar"amx_namechanger""1" )
}

public 
client_spawnid 
{
    if( 
is_user_aliveid ) && get_pcvar_numenabled ) )
    {
        static 
name[33]
        
get_user_name(idnamesizeof name 1)
        
        if( 
equalname"Player" ) || equalname"empty" ) )
        {
            
client_cmdid"messagemode name" )
            
client_printidprint_chat"Please type NOW your new name and press [Enter]" )
            
set_hudmessage255255255, -1.0, -1.004.08.01.02.0, -)
            
show_hudmessageid"Please type NOW your new name and press [Enter]" )            
        }        
    }    
}

public 
client_infochangedid 
{
    
client_spawnid )

TazZ.amxx is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-12-2009 , 22:30   Re: Name Chooser
Reply With Quote #25

Quote:
Originally Posted by Sn!ff3r View Post
PHP Code:
// . . . 
When you post new code, please state what is different or at least say "this is my version of solution. Much easier to interpret why you posted.
__________________
fysiks is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 09-13-2009 , 00:07   Re: Name Chooser
Reply With Quote #26

Quote:
Originally Posted by pizzahut View Post
Good work, Sn!ff3r. I wonder, does your plugin also work if there are several people with the name of "Player" at the same time ("Player", "(1)Player", "(2)Player" etc.)? Over time catching only the first one is sufficient, however on the server where it's used we had tons of people with this name (more than 10) so I wanted the plugin to have an immediate effect on most of them. I thought about using a regular expression module but decided it was a bit of an overkill.
Yes, how about problem of "(1)Player" ""(2)Player" ....?
meigyoku is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-13-2009 , 12:51   Re: Name Chooser
Reply With Quote #27

As far as I can see he fixed at least two things:
- More reliable method for detecting when players spawn.
- Use of persistent CVARs, which are encouraged or even mandatory.
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.
pizzahut is offline
TazZ.amxx
Member
Join Date: Jun 2009
Old 09-14-2009 , 03:19   Re: Name Chooser
Reply With Quote #28

on my CS Server it will not run. I get no message, if I join with the name "Player". I only see, that my name will be change into "empty" !?
TazZ.amxx is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 09-15-2009 , 10:52   Re: Name Chooser
Reply With Quote #29

I've tried my plugin on a listen server (when you run CS and select "new game") and it's working as expected.

If you press Return or Enter your name will come out as "empty" and you will be prompted one more time to enter your name. If you hit Return or Enter a second time, the name will stay as "empty". When you die, and your name is "empty", you will be prompted again when you respawn.

The HUD and chat message that asks you for a name appears when you spawn or respawn.

Or were you talking about Sn!ff3r's plugin?
__________________
My AMXX plugins (content date 2007-03-29, link check 2017-04-26)

Plugins for the Royston Vasey TFC server - These are UNSUPPORTED, except those which have been published at AMX Mod X.

Last edited by pizzahut; 09-15-2009 at 11:00.
pizzahut is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 09-17-2009 , 14:34   Re: Name Chooser
Reply With Quote #30

pizzahut, Which plugin I have to download?
meigyoku is offline
Reply



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 20:09.


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