SA-MP Forums Archive
FORMAT [HELP] - 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: FORMAT [HELP] (/showthread.php?tid=372379)



FORMAT [HELP] - Just1c3 - 26.08.2012

Can someone explain me better the Parameters of the statement Format?

I used to to code in c# , and there it is just , int.parse(string);

Thanks!

Greetz,

Just1c3!


Re: FORMAT [HELP] - HuSs3n - 26.08.2012

did you check this page?
https://sampwiki.blast.hk/wiki/Format
i think it explains it very well


Re: FORMAT [HELP] - Just1c3 - 26.08.2012

Quote:
Originally Posted by HuSs3n
Посмотреть сообщение
did you check this page?
https://sampwiki.blast.hk/wiki/Format
i think it explains it very well
Yes I already visited that page , I always do before posting here a thread.

But I don't just understand the concept,

PHP код:
format(result,sizeof(result), "The number is %i.",number);  //-> The number is 42. 



Re: FORMAT [HELP] - Youice - 26.08.2012

okay, here is an example:
pawn Код:
new result[185], //185 is the limited of the string
name[MAX_PLAYER_NAME]; //defining whole the player's name

GetPlayerName(playerid, name, MAX_PLAYER_NAME); //now we are getting the player's name through that line

format(result, 185/*or sizeof(result) it's the same*/, "MyName: %s", name);
SendClientMessage(playerid, -1, result);
hope it helped


Re: FORMAT [HELP] - Just1c3 - 26.08.2012

Quote:
Originally Posted by Youice
Посмотреть сообщение
okay, here is an example:
pawn Код:
new result[185], //185 is the limited of the string
name[MAX_PLAYER_NAME]; //defining whole the player's name

GetPlayerName(playerid, name, MAX_PLAYER_NAME); //now we are getting the player's name through that line

format(result, 185/*or sizeof(result) it's the same*/, "MyName: %s", name);
SendClientMessage(playerid, -1, result);
hope it helped
Yes it did thanks!