Raised This Month: $51 Target: $400
 12% 

Multilines kick reason


Post New Thread Reply   
 
Thread Tools Display Modes
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-25-2014 , 11:16   Re: Multilines kick reason
Reply With Quote #51

Quote:
Originally Posted by Arkshine View Post
Because \ needs to be escaped.

You could try something like : replace_all( szKickMsg, charsmax( szKickMsg ), "\", "\\" ); before calling server_cmd().
Hi again, i tried and not worked. But i tested this:

PHP Code:
stock Disconnect(const id,const sReason[] = "",any:...)
{
    if(
sReason[0])
    {
        new 
sMessage[192];
        
vformat(sMessage,charsmax(sMessage),sReason,3);
        
        
// Replaced MSG_ONE by MSG_ONE_UNRELIABLE..
        
message_begin(MSG_ONE_UNRELIABLE,SVC_DISCONNECT,{0,0,0},id);
        
write_string(sMessage);
        
        
server_cmd("kick #%i",get_user_userid(id));
        
        
message_end();
    }
    else 
server_cmd("kick #%i",get_user_userid(id));

Using:

PHP Code:
new sName[32];
get_user_name(id,sName,charsmax(sName));

Disconnect(id,"Bye ^n%s",sName); 
And work, but is the correct way?
__________________
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
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 09:17.


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