SA-MP Forums Archive
Anti Caps Lock - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti Caps Lock (/showthread.php?tid=611022)



Anti Caps Lock - sampkinq - 01.07.2016

Hi all! I need anti caps lock script with "İ,Ş,З,Ц,Ь,Ğ" letters. Please help..


Re: Anti Caps Lock - Vince - 01.07.2016

PHP код:
ToLowerExtended(string[], len sizeof string)
{
    for(new 
ileni++)
    {
        
// basic Latin
        
if('A' <= string[i] <= 'Z')
        {
            
string[i] += 0x0020;
            continue;
        }
        
        
// Latin-1 Supplement
        
if((0x00C0 <= string[i] <= 0x00DE) && string[i] != 0x00D7// 00D7 is multiplication symbol
        
{
            
string[i] += 0x0020;
            continue;
        }
        
        
// Latin Extended-A
        
if((0x0100 <= string[i] <= 0x017F) && !(string[i] & 1)) // even numbers are uppercase
        
{
            
string[i] += 0x0001;
            continue;
        }    
    }

Not tested, based off of http://unicode-table.com


Re: Anti Caps Lock - AbyssMorgan - 01.07.2016

PHP код:
stock ToLowerExtended(string[]){
    for(new 
0strlen(string); ji++){
        
string[i] = tolower(string[i]);
    }




Re: Anti Caps Lock - ZiGGi - 01.07.2016

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
PHP код:
stock ToLowerExtended(string[]){
    for(new 
0strlen(string); ji++){
        
string[i] = tolower(string[i]);
    }

No, tolower and toupper functions working only with A..Z symbols.


Re: Anti Caps Lock - Gammix - 01.07.2016

Quote:
Originally Posted by ZiGGi
Посмотреть сообщение
No, tolower and toupper functions working only with A..Z symbols.
tolower already have those checks internally.


Re: Anti Caps Lock - ZiGGi - 01.07.2016

tolower on Windows server uses WinAPI function CharLower, and this function works with all ANSI symbols.
tolower on Linux server uses C function tolower, and this function works only with A..Z symbols.


Re: Anti Caps Lock - AbyssMorgan - 02.07.2016

ZCMD using tolower, and worked.