enum caInfo
{
caManager[24],
caManager2[24],
caManager3[24],
caKrupie[24],
caKrupie2[24],
caKrupie3[24],
caKrupie4[24],
caKrupie5[24],
caKrupie6[24],
caKrupie7[24],
caKrupie8[24],
caKrupie9[24],
caKrupie10[24]
}
new CasinoInfo[1][caInfo];
publics: CallBackCasino()
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows) return printf("Не загружено");
{
CasinoInfo[0][caKrupie] = cache_get_field_content_int(0,"Krupie",dbHandle);
CasinoInfo[0][caKrupie2] = cache_get_field_content_int(0,"Krupie2",dbHandle);
CasinoInfo[0][caKrupie3] = cache_get_field_content_int(0,"Krupie3",dbHandle);
CasinoInfo[0][caKrupie4] = cache_get_field_content_int(0,"Krupie4",dbHandle);
CasinoInfo[0][caKrupie5] = cache_get_field_content_int(0,"Krupie5",dbHandle);
CasinoInfo[0][caKrupie6] = cache_get_field_content_int(0,"Krupie6",dbHandle);
CasinoInfo[0][caKrupie7] = cache_get_field_content_int(0,"Krupie7",dbHandle);
CasinoInfo[0][caKrupie8] = cache_get_field_content_int(0,"Krupie8",dbHandle);
CasinoInfo[0][caKrupie9] = cache_get_field_content_int(0,"Krupie9",dbHandle);
CasinoInfo[0][caKrupie10] = cache_get_field_content_int(0,"Krupie10",dbHandle);
CasinoInfo[0][caManager] = cache_get_field_content_int(0,"Manager",dbHandle);
CasinoInfo[0][caManager2] = cache_get_field_content_int(0,"Manager2",dbHandle);
CasinoInfo[0][caManager3] = cache_get_field_content_int(0,"Manager3",dbHandle);
}
return printf("Загружно");
}
gamemodeinit
mysql_function_query(dbHandle,"SELECT * FROM `casino`", true, "CallBackCasino", "");
CREATE TABLE IF NOT EXISTS `casino` (
`Krupie` varchar(24) NOT NULL DEFAULT '-',
`Krupie2` varchar(24) NOT NULL DEFAULT '-',
`Krupie3` varchar(24) NOT NULL DEFAULT '-',
`Krupie4` varchar(24) NOT NULL DEFAULT '-',
`Krupie5` varchar(24) NOT NULL DEFAULT '-',
`Krupie6` varchar(24) NOT NULL DEFAULT '-',
`Krupie7` varchar(24) NOT NULL DEFAULT '-',
`Krupie8` varchar(24) NOT NULL DEFAULT '-',
`Krupie9` varchar(24) NOT NULL DEFAULT '-',
`Krupie10` varchar(24) NOT NULL DEFAULT '-',
`Manager` varchar(24) NOT NULL DEFAULT '-',
`Manager2` varchar(24) NOT NULL DEFAULT '-',
`Manager3` varchar(24) NOT NULL DEFAULT '-'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
publics: CallBackCasino()
{
new rows, fields;
cache_get_data(rows, fields);
if(!rows) return printf("Не загружено");
{
cache_get_field_content(CasinoInfo[0][caKrupie], "Krupie", CasinoInfo[0][caKrupie], dbHandle, strlen(CasinoInfo[0][caKrupie]));
cache_get_field_content(CasinoInfo[0][caKrupie2], "Krupie2", CasinoInfo[0][caKrupie2], dbHandle, strlen(CasinoInfo[0][caKrupie2]));
cache_get_field_content(CasinoInfo[0][caKrupie3], "Krupie3", CasinoInfo[0][caKrupie3], dbHandle, strlen(CasinoInfo[0][caKrupie3]));
cache_get_field_content(CasinoInfo[0][caKrupie4], "Krupie4", CasinoInfo[0][caKrupie4], dbHandle, strlen(CasinoInfo[0][caKrupie4]));
cache_get_field_content(CasinoInfo[0][caKrupie5], "Krupie5", CasinoInfo[0][caKrupie5], dbHandle, strlen(CasinoInfo[0][caKrupie5]));
cache_get_field_content(CasinoInfo[0][caKrupie6], "Krupie6", CasinoInfo[0][caKrupie6], dbHandle, strlen(CasinoInfo[0][caKrupie6]));
cache_get_field_content(CasinoInfo[0][caKrupie7], "Krupie7", CasinoInfo[0][caKrupie7], dbHandle, strlen(CasinoInfo[0][caKrupie7]));
cache_get_field_content(CasinoInfo[0][caKrupie8], "Krupie8", CasinoInfo[0][caKrupie8], dbHandle, strlen(CasinoInfo[0][caKrupie8]));
cache_get_field_content(CasinoInfo[0][caKrupie9], "Krupie9", CasinoInfo[0][caKrupie9], dbHandle, strlen(CasinoInfo[0][caKrupie9]));
cache_get_field_content(CasinoInfo[0][caKrupie10], "Krupie10", CasinoInfo[0][caKrupie10], dbHandle, strlen(CasinoInfo[0][caKrupie10]));
cache_get_field_content(CasinoInfo[0][caManager], "Manager", CasinoInfo[0][caManager], dbHandle, strlen(CasinoInfo[0][caManager]));
cache_get_field_content(CasinoInfo[0][caManager2], "Manager2", CasinoInfo[0][caManager2], dbHandle, strlen(CasinoInfo[0][caManager2]));
cache_get_field_content(CasinoInfo[0][caManager3], "Manager3", CasinoInfo[0][caManager3], dbHandle, strlen(CasinoInfo[0][caManager3]));
printf("Загружно");
}
}
че как попало базой данных пользуемся?
делать нужно отдельную таблицу под названием допустим casino_workers структура типа - account_id (идентификатор аккаунта), level (0 - крупье, 1 - менеджер) таким образом мы избавляемся от проблемы в виде ограничения на количество крупье и менеджеров. и смотреть приятнее. |