Raised This Month: $ Target: $400
 0% 

Can somebody add a cvar on this plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
petrov_belota
Member
Join Date: Mar 2008
Old 01-31-2009 , 09:38   Can somebody add a cvar on this plugin
Reply With Quote #1

Hi all
Can somebody help me to compete one plugin ?
I have rewrite one plugin:


PHP Code:
#include <amxmodx>
#include <fakemeta>
#define PLUGIN_NAME "No_Name"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "Volta"
new const g_reason[] = "[AMXX] Sorry, name change isn't allowed on this server !"
new const g_name[] = "name"
public plugin_init() {
 
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
 
register_forward(FM_ClientUserInfoChanged"fwClientUserInfoChanged")
}
public 
fwClientUserInfoChanged(idbuffer) {
 if (!
is_user_connected(id))
  return 
FMRES_IGNORED
 
static name[32], val[32]
 
get_user_name(idnamesizeof name 1)
 
engfunc(EngFunc_InfoKeyValuebufferg_namevalsizeof val 1)
 if (
equal(valname))
  return 
FMRES_IGNORED
 engfunc
(EngFunc_SetClientKeyValueidbufferg_namename)
 
console_print(id"%s"g_reason)
 
set_hudmessage(255000.300.4106.07.0
  
show_hudmessage(0"[AMXX] V tozi server nemojete da si smenqte imeto"
 return 
FMRES_SUPERCEDE




But I want to have time durring player can change his name ....
And the time to be
determined by cvar command ?!?
Pls help me

Last edited by petrov_belota; 01-31-2009 at 09:44.
petrov_belota is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-31-2009 , 09:46   Re: Can somebody add a cvar on this plugin
Reply With Quote #2

Time after the player has joined ?
Time after new round ?
Time after the player has spawned ?
Time after what ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
petrov_belota
Member
Join Date: Mar 2008
Old 01-31-2009 , 09:50   Re: Can somebody add a cvar on this plugin
Reply With Quote #3

Quote:
Originally Posted by ConnorMcLeod View Post
Time after the player has joined ?
Time after new round ?
Time after the player has spawned ?
Time after what ?
First one (Time after the player has joined )
And when this time is еnd the players in server
to be are NOT allowed to change names
10x in advance
petrov_belota is offline
sianbg
New Member
Join Date: Jul 2008
Old 01-31-2009 , 10:52   Re: Can somebody add a cvar on this plugin
Reply With Quote #4

Why you dont use One change name plugin ?!?
sianbg is offline
petrov_belota
Member
Join Date: Mar 2008
Old 01-31-2009 , 10:59   Re: Can somebody add a cvar on this plugin
Reply With Quote #5

Quote:
Originally Posted by sianbg View Post
Why you dont use One change name plugin ?!?
I need plugin who prohibits on players to change names and when player try to change his name to write Hud massage on the center and to have a cvar command determined time wich players can change the names ...
after join :]
Please I realy need this plugin
petrov_belota is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-31-2009 , 13:11   Re: Can somebody add a cvar on this plugin
Reply With Quote #6

Set to 30sec, change it for your needs.

PHP Code:
#include <amxmodx>

#define MAX_PLAYERS 32

new bool:g_bForceChange[MAX_PLAYERS+1]
new 
g_iCantChange[MAX_PLAYERS+1]
new 
g_pCvarChangeTime

public plugin_init()
{
    
register_plugin("One Name""1.0""Amxx Community")

    
g_pCvarChangeTime register_cvar("amx_change_name""30")

    
register_message(get_user_msgid("SayText") , "Message_SayText")
}

public 
client_putinserverid )
{
    
g_iCantChange[id] = get_systime() + get_pcvar_num(g_pCvarChangeTime)
}

public 
Message_SayText(msg_idmsg_destmsg_entity)
{
    new 
szArg[21]
    
get_msg_arg_string(2szArgcharsmax(szArg))
    if( 
Equal(szArg"#Cstrike_Name_Change") && g_iCantChange[get_msg_arg_int(1)] < get_systime())
        return 
PLUGIN_HANDLED

    
return PLUGIN_CONTINUE
}

public 
client_infochanged(id
{
    if( 
g_iCantChange[id] > get_systime() )
    {
        return
    }

    if(
g_bForceChange[id])
    {
        
g_bForceChange[id] = false
        
return
    }

    if(
is_user_connected(id))
    {
        static 
szNewName[32], szOldName[32]
        static const 
szNameInfo[] = "name"
        
get_user_info(idszNameInfoszNewNamecharsmax(szNewName))
        
get_user_name(idszOldNamecharsmax(szOldName))

        if( !
Equal(szOldNameszNewName) )
        {
            
g_bForceChange[id] = true
            client_print
(idprint_chat"** You are not allowed to change your name")
            
set_user_info(idszNameInfoszOldName)
        }
    } 
}

Equal(const szA[], const szB[])
{
    static 
a0

    a 
szA[i]
    do
    {
        if( 
!= szB[i])
            return 
0
    
}
    while( (
szA[++i]) )

    return 
1

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 01-31-2009 at 13:45.
ConnorMcLeod is offline
petrov_belota
Member
Join Date: Mar 2008
Old 01-31-2009 , 13:31   Re: Can somebody add a cvar on this plugin
Reply With Quote #7

@ConnorMcLeod
10x for plugin but I cant compile the plugin 0.0
It gives me an error 0.0
Can you add a hud massage + fix the error PLS

Last edited by petrov_belota; 01-31-2009 at 13:38.
petrov_belota is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-31-2009 , 13:41   Re: Can somebody add a cvar on this plugin
Reply With Quote #8

change
PHP Code:
new g_iCanChange[MAX_PLAYERS+1]

// -->

new g_iCantChange[MAX_PLAYERS+1
__________________
xPaw is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-31-2009 , 13:45   Re: Can somebody add a cvar on this plugin
Reply With Quote #9

updated.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
petrov_belota
Member
Join Date: Mar 2008
Old 01-31-2009 , 13:49   Re: Can somebody add a cvar on this plugin
Reply With Quote #10

Super
The plugin worked perfect
10x you are a cool guy
Have a + karma dude ;)

Last edited by petrov_belota; 01-31-2009 at 14:46.
petrov_belota 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 01:47.


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