22.06.2013, 02:08
I have an array -
I can access the first and second cell perfectly fine by doing:
And this works perfectly as it is supposed to, the problem arises when I try to access the third cell (sex) by doing:
This gives me:
How can I access the third cell in this array properly?
pawn Код:
new
PoliceModels [] [] = {
{ 165, "Caucasian", "Male" },
{ 166, "African American", "Male" },
{ 280, "Caucasian", "Male" },
{ 281, "Caucasian", "Male" },
{ 282, "Caucasian", "Male" },
{ 283, "Caucasian", "Male" },
{ 284, "African American", "Male" },
{ 285, "Caucasian", "Male" },
{ 286, "Caucasian", "Male" },
{ 287, "Caucasian", "Male" },
{ 163, "African American", "Male" },
{ 164, "Caucasian", "Male" }
};
pawn Код:
#define MODEL_ID (0)
#define MODEL_RACE (1)
AddPlayerClass( PoliceModels[i][MODEL_ID], 0.0, 0.0, 0.0, 0.0, 0,0, 0,0, 0,0 );
format( ClassInfo [i] [Race], 20, PoliceModels [i] [MODEL_RACE] );
pawn Код:
#define MODEL_ID (0)
#define MODEL_RACE (1)
#define MODEL_SEX (2)
AddPlayerClass( PoliceModels[i][MODEL_ID], 0.0, 0.0, 0.0, 0.0, 0,0, 0,0, 0,0 );
format( ClassInfo [i] [Race], 20, PoliceModels [i] [MODEL_RACE] );
format( ClassInfo [i] [Sex], 10, PoliceModels [i] [MODEL_SEX] );
printf( "%s", ClassInfo [i] [Sex] );
Quote:
Originally Posted by Server log
[22:12:01] aucasian
[22:12:01] frican Am [22:12:01] aucasian [22:12:01] aucasian [22:12:01] aucasian [22:12:01] aucasian [22:12:01] frican Am [22:12:01] aucasian [22:12:01] aucasian [22:12:01] aucasian [22:12:01] frican Am [22:12:01] aucasian |