15.06.2014, 12:33
adding values could be easier.
the Float indicates that the variable will be a float type which looks like this 1.0 needs to have the dot in the number, is classified as a float.
after is the name obviously(after the : <name>)
then goes the array index 0 which is how many items there will be in the variable. your using a define MAX_POINTS. just make sure that value is always 1 more then the actual items you have(if you have 4 items then the array size should be 5 to not get buffer overflow).
The last thing is the number of parameters it will contain, which are separated by the comma (,).
example of adding more potions/locations
pawn Код:
new Float:checkpoints[MAX_POINTS][4] = {
after is the name obviously(after the : <name>)
then goes the array index 0 which is how many items there will be in the variable. your using a define MAX_POINTS. just make sure that value is always 1 more then the actual items you have(if you have 4 items then the array size should be 5 to not get buffer overflow).
The last thing is the number of parameters it will contain, which are separated by the comma (,).
example of adding more potions/locations
pawn Код:
new Float:checkpoints[MAX_POINTS][4] = {
{356.7246,215.6280,1008.3828,3.0}, //notice the comma after every line
{324.6546,56.5480,645.3828,1.0},
{553.7246,215.6280,582.3828,3.0},
{923.1453,45.6280,1008.3828,2.2} // the last one does not require a comma!
};