stock RT_getText(rt_lang[], rt_key[])
{
new rt_Trans[128], File:rt_file;
rt_file = fopen ( formatDirectory(rt_lang) , io_read );
format(rt_key, strlen(rt_key)+3, "%s =", rt_key);
while(fread(rt_file, rt_Trans)){
if(strfind(rt_Trans, rt_key, true)==0){
strdel(rt_Trans, 0, strlen("HELLO = "));
return rt_Trans;
}
}
return rt_Trans;
}
HELLO = Hello, %s!
main() {
print(RT_getText("ing", "HELLO"));
}
Hello, %s!
main() {
new string[128];
format(string, 128, RT_getText("ing", "HELLO"), "VeNuZ_");
print(string);
}
Hello, =!
main()
{
new string[128];
format(string, 128, RT::getText("ing", "HELLO"), "VeNuZ_");
print(string);
}
main()
{
new string[128];
formatF(string, RT::getText("ing", "HELLO"), "VeNuZ_");
print(string);
}
stock RT_getText(rt_lang[], rt_key[])
{
new rt_Trans[128], File:rt_file;
rt_file = fopen ( formatDirectory(rt_lang) , io_read );
format(rt_key, strlen(rt_key)+3, "%s", rt_key);
while(fread(rt_file, rt_Trans)){
if(strfind(rt_Trans, rt_key, true)==0){
strdel(rt_Trans, 0, strlen(rt_key)+3);
return rt_Trans;
}
}
return rt_Trans;
}
stock RT_getText(rt_lang[], rt_key[])
{
new rt_Trans[128], File:rt_file;
rt_file = fopen ( formatDirectory(rt_lang) , io_read );
format(rt_key, strlen(rt_key)+3, "%s =", rt_key);
while(fread(rt_file, rt_Trans)){
if(strfind(rt_Trans, rt_key, true) != -1){ // foi mexido aqui
strdel(rt_Trans, 0, strlen(rt_key)+1); // e aqui
return rt_Trans;
}
}
return rt_Trans;
}
stock RT_getText(rt_lang[], rt_key[])
{
new rt_Trans[128], File:rt_file;
rt_file = fopen ( formatDirectory(rt_lang) , io_read );
format(rt_key, strlen(rt_key)+3, "%s", rt_key);
while(fread(rt_file, rt_Trans)){
if(strfind(rt_Trans, rt_key, true)==0){
strdel(rt_Trans, 0, strlen(rt_key)+3);
return rt_Trans;
}
}
return rt_Trans;
}
Cуdigo final:
pawn Код:
|