#1

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

%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 '%'
Reply
#3

%s string %d Number i guess
Reply
#4

Yea,but how to use?I cant find wiki
Reply
#5

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!"
Reply
#6

https://sampwiki.blast.hk/wiki/Format
Reply
#7

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);
Reply
#8

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);
Reply
#9

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

EDIT : Late
Reply
#10

Thanks to all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)