Raised This Month: $95 Target: $400
 23% 

[help]Why doesn't it work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iamyounghill
New Member
Join Date: Dec 2019
Old 12-23-2019 , 00:40   [help]Why doesn't it work?
Reply With Quote #1

I made a sample amxx ,but it doesn't work well .When clients connected ,it makes clients change their name many times,cyclically!
But I just want them to change one time .

[.sma]
..
public client_infochanged( id )
{
if( is_user_admin(id) )
{
format( newname, charsmax( newname ), "%s %s", tag1, oldname );
set_user_info( id, "name", newname );
return PLUGIN_HANDLED;
}

else
{
format( newname, charsmax( newname ), "%s %s", tag2, oldname );
set_user_info( id, "name", newname ) ;
return PLUGIN_HANDLED;
}

return PLUGIN_HANDLED;

}
..

Is the code "return PLUGIN_HANDLED" has some thing worng?

Last edited by iamyounghill; 12-23-2019 at 00:42.
iamyounghill is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-23-2019 , 07:42   Re: [help]Why doesn't it work?
Reply With Quote #2

client_infochanged is a fakemeta forward so you use return return FMRES_ *
__________________
iceeedr is offline
Send a message via Skype™ to iceeedr
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-23-2019 , 08:41   Re: [help]Why doesn't it work?
Reply With Quote #3

client_infochanged isn't called when the client connects. It's called when the player's info changes, which happens quite often.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-26-2019 , 04:48   Re: [help]Why doesn't it work?
Reply With Quote #4

Probably need to use client_putinserver() or client_authorized() (which ever one happens first). Note that the order is indeterminate so you'll have to implement it so that it happens in that later one.
__________________
fysiks 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 08:23.


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