Raised This Month: $79 Target: $400
 19% 

RTL-Chat Module?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 07-30-2020 , 04:21   RTL-Chat Module?
Reply With Quote #1

Hi, is there someone who interesting to make like this plugin for GoldSrc? or it can be done until? inferiority but valve won't do that I'm confused... I think it is necessary for me to chat.
https://forums.alliedmods.net/showthread.php?p=1649882
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 08-02-2020 , 13:14   Re: RTL-Chat Module?
Reply With Quote #2

I don't think there is, but it can be done.

Looking at the source file of the sm plugin, it just detects when someone typed a RTL character (via UTF-8, which is really small list of languages (about 10) and just flips the relevent part of the string.

Since goldsrc supports UTF-8 text starting from steampipe update back in Aug 2013, it shouldn't be a problem.
__________________

I'm awesome, and I really like cookies.

Last edited by simanovich; 08-02-2020 at 13:15.
simanovich is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-02-2020 , 13:44   Re: RTL-Chat Module?
Reply With Quote #3

Maybe if you mean with the Hebrew language then it's no problem because the words consist of separate letters from right to left if I'm not mistaken. As for the Arabic language, its letters in the word are related (its shape changes, not as it was) in order to give a clear meaning and word.
To solve this problem, I must resort to sites or programs to convert it like this site or notpad++....this takes a lot of time and a tiring way
I am looking for support to solve this problem.
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
r0ma
Senior Member
Join Date: Apr 2012
Location: Great Tomb of Nazarick
Old 08-03-2020 , 20:25   Re: RTL-Chat Module?
Reply With Quote #4

test
PHP Code:
#include <amxmodx>

#pragma semicolon 1
#pragma dynamic 32768

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "alongub"

new Float:minimum 0.1;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""clcmdSay");
}

public 
clcmdSay(id) {
    new 
buffer[192], tokens[96][96], words[96][96], rtledWords;
    
    
read_args(buffercharsmax(buffer));
    
remove_quotes(buffer);
    
replace_all(buffercharsmax(buffer), "%""");
    
    new 
explode_string(buffer" "tokenssizeof tokenssizeof tokens);
    
    for(new 
ini++) {
        if(
WordAnalysis(tokens[i]) >= minimum) {
            
ReverseString(tokens[i], sizeof(tokens[]), words[n-1-i]);
            
rtledWords++;
        }
        else {
            new 
firstWord i;
            new 
lastWord i;
            
            while (
lastWord && WordAnalysis(tokens[lastWord]) < minimum)
            {
                
lastWord++;
            }
            
            for (new 
lastWord 1>= firstWordt--)
            {
                
copy(words[n-1-i], sizeof(tokens[]), tokens[t]);
                
                if (
firstWord)
                    
i++;
            }
        }
    }
    
    if(
rtledWords) {
        
implode_strings(wordsn" "buffersizeof(words[]));
        
        new 
name[33], alive is_user_alive(id);
        
get_user_name(idnamecharsmax(name));
        
        for(new 
1<= MaxClientsi++) {
            if(
id == || alive == is_user_alive(i))
                
client_print_color(iid"^x03%s^x01 : %s"namebuffer);
        }
        
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;
}

stock ReverseString(str[], maxlengthbuffer[]) {
    for (new 
character strlen(str); character >= 0character--)
    {
        if (
str[character] >= 0xD6 && str[character] <= 0xDE)
            continue;
        
        if (
character && str[character 1] >= 0xD7 && str[character 1] <= 0xD9)
            
format(buffermaxlength"%s%c%c"bufferstr[character 1], str[character]);
        else
            
format(buffermaxlength"%s%c"bufferstr[character]);
    }
}

stock Float:WordAnalysis(word[]) {
    new 
count 0length strlen(word);
    
    for (new 
0length 1n++) {
        if (
IsRTLCharacter(wordn)) {
            
count++;
            
n++;
        }
    }
    
    return 
float(count) * length;
}

stock IsRTLCharacter(str[], n) {
    return (
str[n] >= 0xD6 && str[n] <= 0xDE && str[1] >= 0x80 && str[1] <= 0xBF);

__________________
Quote:
Originally Posted by Chihuahuax View Post
If you want to apply these settings to all players, try: (shouldnt be considered as slow-hacking==)
Quote:
Originally Posted by rak View Post
ayudamos.. pero no de la forma que quiere la mayoria
r0ma is online now
Send a message via MSN to r0ma
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 08-04-2020 , 04:04   Re: RTL-Chat Module?
Reply With Quote #5

@r0ma
Yes, it works on turning letters from left to right, but it remains separate letters and does not form a word ... Originally it must be related.
Here someone wants to fix this but don't work with me anyway
http://codepad.org/WxEArf4A
he tries to convert separate letters to attached letters form to make a word using replace_all native
check this too:
https://forums.alliedmods.net/showpo...40&postcount=6

btw even if that works, there will be unsatisfactory results (because we must check that the letter in every word if it is in the middle, beginning or end of it ... before we convert it ... a set of complications) but it is better than nothing
__________________

Last edited by abdobiskra; 08-04-2020 at 04:11. Reason: btw
abdobiskra is offline
Send a message via Skype™ to abdobiskra
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 06:28.


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