Quote:
Originally Posted by Konstantinos
https://sampwiki.blast.hk/wiki/Keywords:Initialisers#enum
PHP код:
enum e_array
{
e_string[32], // change the value to "fit" the whole text
e_integer,
Float: e_float
};
new array[][e_array] =
{
{"string", 0, 1.0}
};
get_data(index, a[], &b, &Float: c)
{
if (!(0 <= index < sizeof array)) return; // invalid index, prevent from run time error 4
strcat((a[0] = EOS, a), array[index][e_string], 32); // reset and copy
b = array[index][e_integer];
c = array[index][e_float];
}
Even though I don't understand why would you want to call a function when you can use "array" directly.
|
Oops, thank you. It was just an example.