02.09.2013, 04:56
Quote:
Fortunately, PAWN (much like any other computer language) supports bi or even tri dimensional arrays, allowing you to store extra data on different indexes on different dimensions!.
For the example Borg posted, the first dimension would represent the index of each text, and the second dimension would store the characters of each string (with a max of 32). |
Here's some more description:
pawn Код:
new crimeArray[8][32] = {
{"Reckless Driving"}, // Can be accessed with "crimeArray[0]"
{"Vehicular Homicide"}, // Can be accessed with "crimeArray[1]"
{"vehicular manslaughter"}, // Can be accessed with "crimeArray[2]"
{"vehicular assault"}, // Can be accessed with "crimeArray[3]"
{"hit and run"}, // Can be accessed with "crimeArray[4]"
{"water eluding"}, // Can be accessed with "crimeArray[5]"
{"air eluding"}, // Can be accessed with "crimeArray[6]"
{"rTest"} // Can be accessed with "crimeArray[7]"
};
//----In some function or callback
new cStr[128];
format(cStr, sizeof(cStr), "You are being charged with %s, and you will only be let out of jail if you are bailed out by another player. The bail price is $%d.", crimeArray[3], 5600);
You are being charged with vehicular assault, and you will only be let out of jail if you are bailed out by another player. The bail price is $5600.