Raised This Month: $ Target: $400
 0% 

Multilines kick reason


Post New Thread Reply   
 
Thread Tools Display Modes
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-01-2014 , 11:15   Re: Multilines kick reason
Reply With Quote #31

Don't use this.
Message is only a part of the kick process.
Doing this and server won't be informed that client has been kicked, it can make some problems on dll or engine.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-01-2014 , 17:14   Re: Multilines kick reason
Reply With Quote #32

Quote:
Originally Posted by ConnorMcLeod View Post
Don't use this.
Message is only a part of the kick process.
Doing this and server won't be informed that client has been kicked, it can make some problems on dll or engine.
Thanks... I still using and server is crashing.
I do not using more this.

For Multi lines kick reason, any possibility to do this?
I tried to use a normal kick + console_print to show informations for players, but the console_print wont working when i kick player checked in client_authorized.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 02-01-2014 at 17:17. Reason: :P
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-01-2014 , 21:54   Re: Multilines kick reason
Reply With Quote #33

Try this and tell me if it is working without crashing :

Code:
user_kick(id, fmt[] = "", any:...)
{
	if( fmt[0] )
	{
		new szKickMsg[192], len = vformat(szKickMsg, charsmax(szKickMsg), fmt, 3), bool:bMultiLines;

		for(--len; len>=0; len--)
		{
			if( szKickMsg[len] == '^n' )
			{
				if( !bMultiLines )
				{
					bMultiLines = true:
					message_begin(MSG_ONE, SVC_DISCONNECT, _, id);
					write_string(szKickMsg);
					message_end();
				}

				szKickMsg[len] = '\';
			}
		}

		server_cmd("kick #%d %s", get_user_userid(id), szKickMsg);
		if( bMultiLines )
		{
			server_exec();
		}
	}
	else
	{
		server_cmd("kick #%d", get_user_userid(id));
	}
}
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-02-2014 at 04:42.
ConnorMcLeod is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 02-01-2014 , 22:13   Re: Multilines kick reason
Reply With Quote #34

Quote:
Originally Posted by ConnorMcLeod View Post
Try this and tell me if it is working without crashing :

Code:
user_kick(id, fmt[] = "", any:...)
{
	if( fmt[0] )
	{
		new szKickMsg[192], len = vformat(szKickMsg, charsmax(szKickMsg), fmt, 3);

		message_begin(MSG_ONE, SVC_DISCONNECT, _, id);
		write_string(szKickMsg);
		message_end();

		for(--len; len>=0; len--)
		{
			if( szKickMsg[len] == '^n' )
			{
				szKickMsg[len] = '|';
			}
		}

		server_cmd("kick #%d %s", get_user_userid(id), szKickMsg);
		server_exec();
	}
	else
	{
		server_cmd("kick #%d", get_user_userid(id));
	}
}
What about an Orpheu way? Just saying..
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-02-2014 , 01:01   Re: Multilines kick reason
Reply With Quote #35

I not tested, but if the problem is the

PHP Code:
        message_begin(MSG_ONESVC_DISCONNECT_id);         write_string(szKickMsg);         message_end() 
For engine, i do not using it but the orpheu way is to more sexy
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-02-2014 , 01:48   Re: Multilines kick reason
Reply With Quote #36

Quote:
Originally Posted by ^SmileY View Post
For engine, i do not using it but the orpheu way is to more sexy
You clearly have no idea what you are talking about. If you are not using the engine module and you are using AMX Mod X then you are probably doing something wrong.
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-02-2014 , 04:30   Re: Multilines kick reason
Reply With Quote #37

Quote:
Originally Posted by meTaLiCroSS View Post
What about an Orpheu way? Just saying..
This way is simple and, if it works fine, efficient, why would we bother to search for a way implying orpheu ?

Function edited again so message is only sent when there are more than one line.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 02-02-2014 at 04:43.
ConnorMcLeod is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-02-2014 , 10:50   Re: Multilines kick reason
Reply With Quote #38

Quote:
Originally Posted by fysiks View Post
You clearly have no idea what you are talking about. If you are not using the engine module and you are using AMX Mod X then you are probably doing something wrong.
Really? I not talking about ENGINE, it is about this

Quote:
Don't use this.
Message is only a part of the kick process.
Doing this and server won't be informed that client has been kicked, it can make some problems on dll or engine.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 02-02-2014 at 10:50.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-03-2014 , 01:14   Re: Multilines kick reason
Reply With Quote #39

Quote:
Originally Posted by ^SmileY View Post
Quote:
Don't use this.
Message is only a part of the kick process.
Doing this and server won't be informed that client has been kicked, it can make some problems on dll or engine.
That's why i made that stock that seems to fix the problem, but you seems to be bound.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 02-03-2014 , 05:09   Re: Multilines kick reason
Reply With Quote #40

I tested and work reall thanks, is not the problem using this. The really problem with a original posted method, is the random crash in ramdom moments (I think the player is not fully connected to server)

Beacause i using this in client_authorized function.

EDIT:
Tested again and is broken (I think i not uploaded the code to correct folder, and used the old method to multi lines kick)
This will sendind a message, but in this way:

"Hi,\You're Kicked from this server:\ for being AFK"

Sorry, not worked
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 

Last edited by ^SmileY; 02-11-2014 at 09:55.
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
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 16:19.


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