Quote:
Originally Posted by Arkshine
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?
__________________