#4

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]);
}

...
On another note, "id" should be set as primary key and that's one of the reasons you should learn SQL and don't rely to such includes: the best way to save weapons: https://sampforum.blast.hk/showthread.php?tid=505081
Reply


Messages In This Thread
help - by GeneralAref - 25.11.2016, 13:34
Re: help - by Konstantinos - 25.11.2016, 13:39
Re: help - by GeneralAref - 25.11.2016, 13:42
Re: help - by Konstantinos - 25.11.2016, 13:58
Re: help - by GeneralAref - 25.11.2016, 15:02
Re: help - by GeneralAref - 25.11.2016, 16:44

Forum Jump:


Users browsing this thread: 1 Guest(s)