Template:FormatStrings2

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:19, 21 April 2014
MP2 (Talk | contribs)

← Previous diff
Current revision
IstuntmanI (Talk | contribs)
(add the "a" placeholder and a note for it; changed "inserts" to "passes")
Line 3: Line 3:
! Placeholder || Meaning ! Placeholder || Meaning
|- |-
-| c || Inserts a single character.+| '''a''' || Passes an array (the next placeholder should be '''d''' or '''i''' for the array size, so the function will be aware of it).
 +'''NOTE:''' It accepts only one dimension, so a trick like ''sizeof (array) + sizeof (array) * sizeof (array[])'' for the array size would be needed to pass a 2D array.
|- |-
-| d, i || Inserts an integer (whole) number+| '''c''' || Passes a single character.
|- |-
-| x || Inserts a number in hexadecimal notation.+| '''d''', '''i''' || Passes an integer (whole) number
|- |-
-| f || Inserts a floating point number.+| '''x''' || Passes a number in hexadecimal notation.
|- |-
-| s || Inserts a string.+| '''f''' || Passes a floating point number.
 +|-
 +| '''s''' || Passes a string.
|} |}
The values for the placeholders follow in the exact same order as parameters in the call. The values for the placeholders follow in the exact same order as parameters in the call.

Current revision

Format Strings

Placeholder Meaning
a Passes an array (the next placeholder should be d or i for the array size, so the function will be aware of it).

NOTE: It accepts only one dimension, so a trick like sizeof (array) + sizeof (array) * sizeof (array[]) for the array size would be needed to pass a 2D array.

c Passes a single character.
d, i Passes an integer (whole) number
x Passes a number in hexadecimal notation.
f Passes a floating point number.
s Passes a string.

The values for the placeholders follow in the exact same order as parameters in the call.

Personal tools