FORMAT [HELP]
#1

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!
Reply
#2

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

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. 
Reply
#4

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
Reply
#5

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)