09.08.2010, 07:26
(
Последний раз редактировалось smeti; 09.08.2010 в 07:42.
)
Quote:
Hi. I've a problem with this code. The code don't convert the string to standard link. Please help!
pawn Код:
|
pawn Код:
#include <a_samp>
public
OnGameModeInit()
{
print(ConvertToLinkString("Megszentsйgtelenнthetetlensйgeskedйseitekйrt."));
print(ConvertToLinkString("йpй"));
print(ConvertToLinkString(" ,UtŰ-н+ [67 ? бн ő:)P"));
return 1;
}
new
table[] =
{
'P', 'Ц', 'ц', 'ő', 'Ő', 'ъ', 'Ъ', 'Ь', 'ь', 'У', 'у', 'й', 'Й', 'Б', 'б', 'ű', 'Ű', 'н', 'Н'
};
new
table2[][] =
{
"MбkosTйszta", "%C3%96", "%C3%B6", "%C5%91", "%C5%90", "%C3%BA", "%C3%9A", "%C3%9C", "%C3%BC", "%C3%93",
"%C3%B3", "%C3%A9", "%C3%89", "%C3%81", "%C3%A1", "%C5%B1", "%C5%B0", "%C3%AD", "%C3%8D"
};
stock
ConvertToLinkString(string[])
{
new
string2[256],
Index,
i = 0;
while(string[i])
{
for(new j = 0; j < sizeof(table); j++)
{
if(string[i] == table[j])
{
for(new k = 0, lenght = strlen(table2[j]); k < lenght; k++) { string2[Index++] = table2[j][k]; }
break;
}
if(j == sizeof(table)-1 && string[i] != table[j]) string2[Index++] = string[i]; // Ha nem йkezetes karakter!
}
++i;
}
return string2;
Код:
[09:43:08] Megszents%C3%A9gtelen%C3%ADthetetlens%C3%A9gesked%C3%A9seitek%C3%A9rt. [09:43:08] %C3%A9p%C3%A9 [09:43:08] ,Ut%C5%B0-%C3%AD+ [67 ? %C3%A1%C3%AD %C5%91:)MбkosTйszta