Thread: [INC] New chars
View Single Post
Author Message
diablix
Senior Member
Join Date: Jan 2010
Location: Warsaw, Poland
Old 08-15-2011 , 19:38   [INC] New chars
Reply With Quote #1

New chars
by diablix


At the begining I'll just say that my english isn't good.

Here is what I mean (Yes, in this example I used Polish letters)



Stock that allows you to use new letters.
These letters with my stock can be coded with UTF8 HEX system metod.

A lot of compilers (like AMXX-Studio) won't allow you to compile some "weird" chars (everything is automatically coded into ASCII) but with this stock it is posibble.

How to?

Add here the char that you wanna use with the stock (if u don't get it, hope you will at the end) For example, we'll make REGISTERED SIGN. I'll name it as 'R'

PHP Code:
new const chNewChars[] = {
    
'ą',
    
'ó',
    
'ę',
    
'ż',
    
'ź',
    
'ł',
    
'ń',
    
'ć',
    
'ś',
    
    
'Ą',
    
'Ó',
    
'Ę',
    
'Ż',
    
'Ź',
    
'Ł',
    
'Ń',
    
'Ć',
    
'Ś',
    
'R'
}; 
Now here, add the UTF8 code in HEX system. List of chars can be found Here.

it should be in format

{0xFFFFFF**, 0xFFFFFF**, 0}

For example

The bolded text is what we are looking for

U+00AE ® c2 ae REGISTERED SIGN

so to add that char you will have to extend the table and add your utf8 combination. Our "registered sign" had c2 ae so the code will look like this :

{0xFFFFFFC2, 0xFFFFFFAE, 0}

PHP Code:
new const iUTF8_HEX[sizeof chNewChars][] = { 
    {
0xFFFFFFC4,  0xFFFFFF850},     // ą
    
{0xFFFFFFC3,  0xFFFFFFB30},     // ó
    
{0xFFFFFFC4,  0xFFFFFF990},    // ę
    
{0xFFFFFFC5,  0xFFFFFFBC0},    // ż
    
{0xFFFFFFC5,  0xFFFFFFBA0},    // ź
    
{0xFFFFFFC5,  0xFFFFFF820},    // ł
    
{0xFFFFFFC5,  0xFFFFFF840},    // ń
    
{0xFFFFFFC4,  0xFFFFFF870},    // ć
    
{0xFFFFFFC5,  0xFFFFFF9B0},    // ś
    
    
{0xFFFFFFC4,  0xFFFFFF840},     // Ą
    
{0xFFFFFFC3,  0xFFFFFF930},     // Ó
    
{0xFFFFFFC4,  0xFFFFFF980},     // Ę
    
{0xFFFFFFC5,  0xFFFFFFBB0},     // Ż
    
{0xFFFFFFC5,  0xFFFFFFB90},     // Ź
    
{0xFFFFFFC5,  0xFFFFFF810},     // Ł
    
{0xFFFFFFC5,  0xFFFFFF830},     // Ń
    
{0xFFFFFFC4,  0xFFFFFF860},     // Ć
    
{0xFFFFFFC5,  0xFFFFFF9A0},     // Ś
    
{0xFFFFFFC2,  0xFFFFFFAE0}      // (R) SIGN
}; 
And now just use the modified include in your plugin.

And here is the part with "sign name".

PHP Code:
#include <newchars>
public plugin_init() {
    new 
sSign[3];
    
newChar('R'sSignsizeof sSign 1); //We named it as 'R' in chNewChars
    
    
client_print(03"REGISTERED SIGN : %s"sTab);

In the attachment you got only version with polish letters. To add your own chars, just follow How To guide.
Attached Files
File Type: inc newchars.inc (1.3 KB, 550 views)

Last edited by diablix; 08-15-2011 at 19:42.
diablix is offline
Send a message via Skype™ to diablix