SA-MP Forums Archive
Convert number - 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 number (/showthread.php?tid=603888)



Convert number - Johnny_Ionut - 28.03.2016

Hi everyone!
How can I convert a number for the command / stats instead occur for example Phone: 1234567, occur Phone: 123-4567
Thanks.


Re: Convert number - Lucky13 - 28.03.2016

Hey! This is a simple command I made in a new Pawno file.

Код:
if (strcmp("/number", cmdtext, true, 10) == 0)
	{
	    new string[7];
	    new phonenumber[]="123456";
		new size=strlen(phonenumber);
		strins(phonenumber,"-",size/2);
		format(string,sizeof(string),"%s",phonenumber);
		SendClientMessage(playerid,-1,string);
		return 1;
	}
All you have to do is to replace the phonenumber with your variable, as mine is only an example. Feel free to test it.