SA-MP Forums Archive
Convert numbers to text - 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: Convert numbers to text (/showthread.php?tid=348996)



Convert numbers to text - milanosie - 07.06.2012

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


Re: Convert numbers to text - Niko_boy - 07.06.2012

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 :>


Re: Convert numbers to text - Chris1337 - 07.06.2012

strfind(text, i think


Re: Convert numbers to text - Niko_boy - 07.06.2012

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


Re: Convert numbers to text - Babul - 07.06.2012

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


Re: Convert numbers to text - Niko_boy - 07.06.2012

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

meh try it out ...


Re: Convert numbers to text - milanosie - 07.06.2012

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