key in string
#1

How I can take a key in a string?
example:
pawn Код:
format(string,sizeof(string),"Press %s to select",KEY_FIRE);
but doesn't work.
Reply
#2

Why? Showing or printing a key will most likely not work or come up wierd. Just type LMB ( Left mouse button ).
Reply
#3

its better, because other languages has a other name for it.
example in german is a other word for left mouse button.
and its working, i know i has it a time ago, but i forgotten it -.-
Reply
#4

Keys are defined as integers, not strings, so use %i or %d to format them correctly.
Reply
#5

Quote:
Originally Posted by Don Correlli
Keys are defined as integers, not strings, so use %i or %d to format them correctly.
%i, because %d is for floats
Reply
#6

now it comes "4" but i like to get the name from it.
Reply
#7

Quote:
Originally Posted by Jakku
%i, because %d is for floats
Learn some basics, %f is for float type.. not %d
Reply
#8

ok, but i get "4" if i write %d or %i..
i like to get the name from the key.
Reply
#9

Quote:
Originally Posted by Headshot1108
now it comes "4" but i like to get the name from it.
That's why I said:
Quote:

Showing or printing a key will most likely not work or come up wierd. Just type LMB ( Left mouse button ).

Just replace your format with LMB or something similar.
Reply
#10

-.- i already has a time ago!!
Its working and i know.
but im bad and i forgot it <.<
its better for 'non english' people, or rather people who does not can good english
and then they know better what they must type
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)