[Ajuda] Integraзгo gm e fs
#3

Digamos:

Quote:

new timejail,
timemute,
timecmute;

enum UserEnum
{
//saved data
u_admin,
u_vip,
u_kills,
u_deaths,
u_score,
u_money,
u_hours,
u_minutes,
u_seconds,
u_cash,
u_kicked,

//saved counts
u_kickedcount,
u_jailedcount,
u_jailedtimecount,
u_mutedcount,
u_mutedtimecount,
u_cmutedcount,
u_cmutedtimecount,

//not saved data
u_attempts,
u_selectionclass,
u_selectedclass,
u_sessionkills,
u_sessiondeaths,
u_spree,
u_chattime,
u_chattext[144],
Text3D:u_duty3dtext,
u_lastreported,
u_lastreportedtime,
u_updatetimer,

//conditions data
u_jailed,
u_jailtime,
u_muted,
u_mutetime,
u_cmuted,
u_cmutetime,
u_specdata[2],
Float:u_specpos[4],
u_vehicle,
u_warnings,

//pm data
u_lastuser,

//spectate data
u_specid,
bool:u_spec,
Float:u_pos[3],
u_int,
#if defined SPECTATE_TEXTDRAW
PlayerText:u_spectxt,
#endif
u_vw
};
new gUser[MAX_PLAYERS][UserEnum];

//------------------------------------------------

enum GlobalEnum
{
s_usertable,
s_statscount,
s_bantable,
s_rangebantable,
s_fwordstable,
s_fnamestable,
s_ftagstable,
s_fwordscount,
s_fnamescount,
s_ftagscount,
bool_locked,
Text_locktd[3],
#if defined REPORT_TEXTDRAW
Text_reporttd
#endif
}
new gGlobal[GlobalEnum];

Para verificar as Enum's do GM (copiados do FS)

Quote:

if(! DB::Open(LOCATION_DATABASE))
{
printf("[TKAdminv3] - ERROR: The filterscript couldn't be loaded cause the database file(%s) wasn't opened.", LOCATION_DATABASE);
return 0;
}

gGlobal[s_usertable] = DB::VerifyTable(TABLE_USERS, "ID");
if(gGlobal[s_usertable] == DB_INVALID_TABLE)
{
printf("[TKAdminv3] - ERROR: The Users table(%s) couldn't be verified.", TABLE_USERS);
}
else
{
DB::VerifyColumn(gGlobal[s_usertable], "username", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "password", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "ip", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "joindate", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "laston", DB::TYPE_STRING, "");
DB::VerifyColumn(gGlobal[s_usertable], "kicked", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "jailed", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "jailtime", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "muted", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "mutetime", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "cmuted", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "cmutetime", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "cash", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "admin", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "vip", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "kills", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "deaths", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "score", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "money", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "hours", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "minutes", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "seconds", DB::TYPE_NUMBER, 0);
DB::VerifyColumn(gGlobal[s_usertable], "autologin", DB::TYPE_NUMBER, 0);
}
printf("[TKAdminv3] - NOTICE: Total %i accounts loaded from the table ''%s''", DB::CountRows(gGlobal[s_usertable]), TABLE_USERS);
printf("%i", DB::GetHighestRegisteredKey(gGlobal[s_usertable]));

Neste code acima estб apenas abrindo e verificando se existe as TABLES e as COLUNAS (copiei do FS e joguei no GM)


Tendo isso em vista, estб correto o que eu fiz? Apenas copiar as variбveis e Enum's para que o cуdigo nгo de erro na verificaзгo e para que sejam vбlidas as Colunas...

@EDIT

FUNCIONOU, PORЙM NГO SALVA OS DADOS INGAME, APENAS QUANDO O PLAYER DESCONECTA!
Reply


Messages In This Thread
Integraзгo gm e fs - by F1N4L - 04.12.2015, 22:01
Re: Integraзгo gm e fs - by Lуs - 04.12.2015, 22:08
Re: Integraзгo gm e fs - by F1N4L - 04.12.2015, 23:03

Forum Jump:


Users browsing this thread: 1 Guest(s)