Convert numbers to text
#1

Hello,

No, I'm not talking about integers,
Im talking about like, someone types


"Responding to 911 call"

How could I change it automatically to "Responding to nine one one call"

There must be a way right?,
All I need is probably a start, and that would be enough for me to finish it

Milan
Reply
#2

yes there is
i made one working code for it , but it was a bit buggy
i am trying to figure it out then i might release it :>
Reply
#3

strfind(text, i think
Reply
#4

not realy
it was 2d Arrays + strlen stuff tho that i tried out with
Reply
#5

OnPlayerText():
pawn Код:
new string1[128],string2[128],result[128];
found=strfind(text,"9",true);
if(found>-1)
{
 strmid(string1,text,0,found);
 strmid(string2,text,found+1,128);//+1 is 1 char replaced ("9"). skipping that
 format(result,sizeof(result),"%snine%s",string1,string2);
}
maybe strcat will be faster... if i missed something then excuse me, i cut-n-pasted a few lines from my stringreplacer
Reply
#6

http://forum.sa-mp.com/showpost.php?...postcount=3254

meh try it out ...
Reply
#7

Quote:
Originally Posted by Niko_boy
Посмотреть сообщение
Thanks a lot, going to try it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)