25.11.2016, 13:58
pawn Код:
enum e_create_houses_table
{
e_field[20],
SQL::datatypes: e_type,
e_maxlength,
bool:e_auto_increment
};
new create_houses_table[][e_create_houses_table]=
{
{"id",SQL_TYPE_INT,11,true},
{"canbuy",SQL_TYPE_INT,11,false},
{"bought",SQL_TYPE_INT,11,false},
{"price",SQL_TYPE_INT,11,false},
{"owner_id",SQL_TYPE_INT,11,false},
{"locked",SQL_TYPE_INT,11,false},
{"world",SQL_TYPE_INT,11,false},
{"interior",SQL_TYPE_INT,11,false},
{"weapon_0",SQL_TYPE_INT,11,false},
{"weapon_1",SQL_TYPE_INT,11,false},
{"weapon_2",SQL_TYPE_INT,11,false},
{"weapon_3",SQL_TYPE_INT,11,false},
{"weapon_4",SQL_TYPE_INT,11,false},
{"weapon_5",SQL_TYPE_INT,11,false},
{"weapon_6",SQL_TYPE_INT,11,false},
{"weapon_7",SQL_TYPE_INT,11,false},
{"weapon_8",SQL_TYPE_INT,11,false},
{"weapon_9",SQL_TYPE_INT,11,false},
{"weapon_10",SQL_TYPE_INT,11,false},
{"weapon_11",SQL_TYPE_INT,11,false},
{"ammo_0",SQL_TYPE_INT,11,false},
{"ammo_1",SQL_TYPE_INT,11,false},
{"ammo_2",SQL_TYPE_INT,11,false},
{"ammo_3",SQL_TYPE_INT,11,false},
{"ammo_4",SQL_TYPE_INT,11,false},
{"ammo_5",SQL_TYPE_INT,11,false},
{"ammo_6",SQL_TYPE_INT,11,false},
{"ammo_7",SQL_TYPE_INT,11,false},
{"ammo_8",SQL_TYPE_INT,11,false},
{"ammo_9",SQL_TYPE_INT,11,false},
{"ammo_10",SQL_TYPE_INT,11,false},
{"ammo_11",SQL_TYPE_INT,11,false},
{"seeds",SQL_TYPE_INT,11,false},
{"drugs",SQL_TYPE_INT,11,false},
{"money",SQL_TYPE_INT,11,false},
{"owner_name",SQL_TYPE_VCHAR,20,false},
{"en_x",SQL_TYPE_FLOAT,11,false},
{"en_y",SQL_TYPE_FLOAT,11,false},
{"en_z",SQL_TYPE_FLOAT,11,false},
{"ex_x",SQL_TYPE_FLOAT,11,false},
{"ex_y",SQL_TYPE_FLOAT,11,false},
{"ex_z",SQL_TYPE_FLOAT,11,false}
};
pawn Код:
...
for(new i=0;i<sizeof(create_houses_table);i++)
{
SQL::AddTableEntry(handle, create_houses_table[i][e_field], create_houses_table[i][e_type], create_houses_table[i][e_maxlength], create_houses_table[i][e_auto_increment]);
}
...