SA-MP Forums Archive
%s %d - 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: %s %d (/showthread.php?tid=370476)



%s %d - Vizi - 20.08.2012

Hii to all
Can somebody explene me about %s and %d how that works?
i cant wiki....


Re: %s %d - McCurdy - 20.08.2012

%b Inserts a number at this position in binary radix
%c Inserts a single character.
%d Inserts an integer (whole) number
%f Inserts a floating point number.
%i Inserts an integer.
%s Inserts a string.
%x Inserts a number in hexadecimal notation.
%% Inserts the literal '%'


Re: %s %d - Gangster-rocks - 20.08.2012

%s string %d Number i guess


Re: %s %d - Vizi - 20.08.2012

Yea,but how to use?I cant find wiki


Re: %s %d - Shetch - 20.08.2012

You can use it to show information into messages...
Код:
new variable, string[128];

variable = 1337;

format(string, sizeof(string), "The value of variable is %d!");
print(string);
This would print "The value of variable is 1337!"


Re: %s %d - McCurdy - 20.08.2012

https://sampwiki.blast.hk/wiki/Format


Re : %s %d - ricardo178 - 20.08.2012

Example...

pawn Код:
new string[64], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
format(string, sizeof(string), "My name is: %s", Name);
SendClientMessage(playerid, 0xFFFFFFFF, string);


new lvl, string[64];
lvl = GetPlayerScore(playerid);
format(string, sizeof(string), "My score is %d", lvl);
SendClientMessage(playerid, 0xFFFFFFFF, string);



Re: %s %d - McCurdy - 20.08.2012

Quote:
Originally Posted by Shetch
Посмотреть сообщение
You can use it to show information into messages...
Код:
new variable, string[128];

variable = 1337;

format(string, sizeof(string), "The value of variable is %d!");
print(string);
This would print "The value of variable is 1337!"
I think that like this:

Код:
new variable, string[128];

variable = 1337;

format(string, sizeof(string), "The value of variable is %d!",variable);
print(string);



Re: %s %d - [MM]RoXoR[FS] - 20.08.2012

https://sampwiki.blast.hk/wiki/Format

EDIT : Late


Re: %s %d - Vizi - 20.08.2012

Thanks to all