Raised This Month: $32 Target: $400
 8% 

Right-to-left symbols chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-29-2018 , 07:16   Right-to-left symbols chat
Reply With Quote #1

Hello Can someone make us a similar of this plugin in amxx :
https://forums.alliedmods.net/showthread.php?p=1649882

Wiki for mor info:
https://en.wikipedia.org/wiki/Right-to-left_mark
http://www.fileformat.info/info/unicode ... /index.htm
__________________

Last edited by abdobiskra; 10-29-2018 at 07:16.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-29-2018 , 15:36   Re: Right-to-left symbols chat
Reply With Quote #2

I don't think that can be done via a plugin.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 10-30-2018 , 13:40   Re: Right-to-left symbols chat
Reply With Quote #3

hmm!
This is bad(
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
Mr.J
Senior Member
Join Date: Sep 2017
Location: cs_assault
Old 11-03-2018 , 12:06   Re: Right-to-left symbols chat
Reply With Quote #4

man i think no one can do that ;/ it would be awesome ...
Mr.J is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-03-2018 , 16:01   Re: Right-to-left symbols chat
Reply With Quote #5

Valve can't.
__________________

Last edited by OciXCrom; 11-03-2018 at 16:02.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Mr.EwY
Junior Member
Join Date: Apr 2018
Location: In your mind
Old 11-03-2018 , 16:47   Re: Right-to-left symbols chat
Reply With Quote #6

Do you mean like this ?
Quote:
#include <amxmodx>

public plugin_init()
{
register_plugin("Arabic Chat Fix", "1.0", "Raheem")
register_message(get_user_msgid("SayText"), "msgSayText")
}

public msgSayText()
{
new said[192], said_to_utf16[192], said_to_utf8[576]
get_msg_arg_string(4, said, 191);

replace_all(said, 191, "ا", "ﺎ")
replace_all(said, 191, "ب", "ﺑ")
replace_all(said, 191, "ت", "ﺗ")
replace_all(said, 191, "ث", "ﺛ")
replace_all(said, 191, "ج", "ﺟ")
replace_all(said, 191, "ح", "ﺣ")
replace_all(said, 191, "خ", "ﺧ")
replace_all(said, 191, "س", "ﺳ")
replace_all(said, 191, "ش", "ﺷ")
replace_all(said, 191, "ص", "ﺻ")
replace_all(said, 191, "ض", "ﺿ‎")
replace_all(said, 191, "ع", "ﻋ")
replace_all(said, 191, "غ", "ﻏ")
replace_all(said, 191, "ف", "ﻓ")
replace_all(said, 191, "ق", "ﻗ")
replace_all(said, 191, "ك", "ﻛ")
replace_all(said, 191, "م", "ﻣ")
replace_all(said, 191, "ن", "ﻧ")
replace_all(said, 191, "ي", "ﻳ")
replace_all(said, 191, "ة", "ﺔ")
replace_all(said, 191, "ى", "ﻰ")
replace_all(said, 191, "ه", "ﻪ")
replace_all(said, 191, "ل", "ﻟ")
replace_all(said, 191, "ئ", "ﺋ")

MultiByteToWideChar(said, said_to_utf16)

if(isEnglish(said_to_utf16))
return PLUGIN_CONTINUE;

ReverseString(said_to_utf16)

WideCharToMultiByte(said_to_utf16, said_to_utf

set_msg_arg_string(4, said_to_utf;
}

stock ReverseString(toggle[])
{
for(new i = strlen(toggle) - 1, j = 0, temp ; i > j ; i--, j++)
{
temp = toggle[i];
toggle[i] = toggle[j];
toggle[j] = temp;
}
}

stock MultiByteToWideChar(const mbszInput[], wcszOutput[])
{
new nOutputChars = 0;
for (new n = 0; mbszInput[n] != EOS; n++) {
if (mbszInput[n] < 0x80) { // 0... 1-byte ASCII
wcszOutput[nOutputChars] = mbszInput[n];
} else if ((mbszInput[n] & 0xE0) == 0xC0) { // 110... 2-byte UTF-8
wcszOutput[nOutputChars] = (mbszInput[n] & 0x1F) << 6; // Upper 5 bits

if ((mbszInput[n + 1] & 0xC0) == 0x80) { // Is 10... ?
wcszOutput[nOutputChars] |= mbszInput[++n] & 0x3F; // Lower 6 bits
} else { // Decode error
wcszOutput[nOutputChars] = '?';
}
} else if ((mbszInput[n] & 0xF0) == 0xE0) { // 1110... 3-byte UTF-8
wcszOutput[nOutputChars] = (mbszInput[n] & 0xF) << 12; // Upper 4 bits

if ((mbszInput[n + 1] & 0xC0) == 0x80) { // Is 10... ?
wcszOutput[nOutputChars] |= (mbszInput[++n] & 0x3F) << 6; // Middle 6 bits

if ((mbszInput[n + 1] & 0xC0) == 0x80) { // Is 10... ?
wcszOutput[nOutputChars] |= mbszInput[++n] & 0x3F; // Lower 6 bits
} else { // Decode error
wcszOutput[nOutputChars] = '?';
}
} else { // Decode error
wcszOutput[nOutputChars] = '?';
}
} else { // Decode error
wcszOutput[nOutputChars] = '?';
}

nOutputChars++;
}
wcszOutput[nOutputChars] = EOS;
}

stock WideCharToMultiByte(const wcszInput[], mbszOutput[])
{
new nOutputChars = 0;
for (new n = 0; wcszInput[n] != EOS; n++) {
if (wcszInput[n] < 0x80) {
mbszOutput[nOutputChars++] = wcszInput[n];
} else if (wcszInput[n] < 0x800) {
mbszOutput[nOutputChars++] = (wcszInput[n] >> 6) | 0xC0;
mbszOutput[nOutputChars++] = (wcszInput[n] & 0x3F) | 0x80;
} else {
mbszOutput[nOutputChars++] = (wcszInput[n] >> 12) | 0xE0;
mbszOutput[nOutputChars++] = ((wcszInput[n] >> 6) & 0x3F) | 0x80;
mbszOutput[nOutputChars++] = (wcszInput[n] & 0x3F) | 0x80;
}
}
mbszOutput[nOutputChars] = EOS;
}

isEnglish(const szString[])
{
new i = 0;
new ch;
while((ch = szString[i]) != EOS)
{
if(0x21 <= ch <= 0x7F)
return true;

i++;
}

return false;
}

//if(0x600 <= ch <= 0x6FF) Arabic UniCode Range
Mr.EwY is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 11-07-2018 , 12:57   Re: Right-to-left symbols chat
Reply With Quote #7

@OciXCrom
Where can I contact them please? (valve)
@Mr.EwY
It is not that, but it's part of the subject. I've commented on it before
Our theme is as in the title
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
shauli
Member
Join Date: Jun 2018
Old 11-08-2018 , 06:42   Re: Right-to-left symbols chat
Reply With Quote #8

Quote:
Originally Posted by abdobiskra View Post
@OciXCrom
Where can I contact them please? (valve)
@Mr.EwY
It is not that, but it's part of the subject. I've commented on it before
Our theme is as in the title
How's it now? It prints Arabic chat but in reverse or what?
shauli is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 11-08-2018 , 15:18   Re: Right-to-left symbols chat
Reply With Quote #9

@shauli
This only gives a correction to the characters as I see I did not try it
In Arabic there are connected, separate, and related characters that are used in sentences
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
shauli
Member
Join Date: Jun 2018
Old 11-08-2018 , 18:19   Re: Right-to-left symbols chat
Reply With Quote #10

Quote:
Originally Posted by abdobiskra View Post
@shauli
This only gives a correction to the characters as I see I did not try it
In Arabic there are connected, separate, and related characters that are used in sentences
Can you give me a sentence for example of how it's supposed to be and how it's actually printed now? (without any plugin?)

thanks.
shauli is offline
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 18:46.


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