15.02.2014, 11:23
Код:
stock LoadFactions(){ print("Loading Factions..."); format(Query,sizeof(Query),"SELECT * FROM f_m"); mysql_function_query(MainPipe,Query,true,"OnQueryFinish","i",THREAD_LOADFACTIONS); return 1; }
Код:
forward OnQueryFinish(resultid,extraid,ConnectionHandle); public OnQueryFinish(resultid,extraid,ConnectionHandle){ new temp[14],rows,fields; if(resultid != THREAD_NO_RESULT){ cache_get_data(rows,fields,MainPipe); } switch(resultid){ case THREAD_LOADFACTIONS:{ if(rows){ print("Rows Detected."); for(new i = 0; i < rows; i++){ TotFacs++; cache_get_field_content(i,"fid",temp); fData[TotFacs][fid] = strval(temp); cache_get_field_content(i,"type",temp); fData[TotFacs][fType] = strval(temp); cache_get_field_content(i,"locale",temp); fData[TotFacs][fLocale] = strval(temp); cache_get_field_content(i,"parent",temp); fData[TotFacs][fParent] = strval(temp); cache_get_field_content(i,"abbr",fData[TotFacs][fAbbr]); cache_get_field_content(i,"title",fData[TotFacs][fTitle]); cache_get_field_content(i,"disabled",temp); fData[TotFacs][fDisabled] = strval(temp); cache_get_field_content(i,"disabledReason",fData[TotFacs][fDisabledReason]); cache_get_field_content(i,"disabledAdmin",fData[TotFacs][fDisabledAdmin]); cache_get_field_content(i,"bank",temp); fData[TotFacs][fBank] = strval(temp); cache_get_field_content(i,"phone",temp); fData[TotFacs][fPhone] = strval(temp); cache_get_field_content(i,"defaultdiv",temp); fData[TotFacs][defaultdiv] = strval(temp); cache_get_field_content(i,"defaultjoin",temp); fData[TotFacs][defaultjoin] = strval(temp); cache_get_field_content(i,"defaultleader",temp); fData[TotFacs][defaultleader] = strval(temp); cache_get_field_content(i,"budget",temp); fData[TotFacs][fBudget] = strval(temp); fData[TotFacs][fCreated] = true; printf("[Slot %i] %s Loaded.",TotFacs,fData[TotFacs][fTitle]); } } } } return 1; }
Код:
[09:08:24] [DEBUG] mysql_connect - host: "localhost", user: "samp", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [09:08:24] [DEBUG] CMySQLHandle::Create - creating new connection.. [09:08:24] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [09:08:24] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] mysql_connect - host: "localhost", user: "samp", database: "samp", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [09:08:24] [DEBUG] CMySQLHandle::Create - creating new connection.. [09:08:24] [WARNING] CMySQLHandle::Create - connection already exists [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM f_m", callback: "OnQueryFinish", format: "i" [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM r_m", callback: "OnQueryFinish", format: "i" [09:08:24] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM d_m", callback: "OnQueryFinish", format: "i" [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [09:08:24] [DEBUG] CMySQLConnection::Connect - connection was successful [09:08:24] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [09:08:24] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - starting query execution [09:08:24] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - query was successfully executed within 1.186 milliseconds [09:08:24] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [09:08:24] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - starting query execution [09:08:24] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - query was successfully executed within 0.968 milliseconds [09:08:24] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [09:08:24] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - starting query execution [09:08:24] [DEBUG] Calling callback "OnQueryFinish".. [09:08:24] [DEBUG] CMySQLQuery::Execute[OnQueryFinish] - query was successfully executed within 1.321 milliseconds [09:08:24] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [09:08:24] [DEBUG] cache_get_data - connection: 1 [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "fid", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "fid", data: "1" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "type", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "type", data: "1" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "locale", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "locale", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "parent", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "parent", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "abbr", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "abbr", data: "TestGov" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "title", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "title", data: "Test Government Faction" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "disabled", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "disabled", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "disabledReason", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "disabledReason", data: "N/A" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "disabledAdmin", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "disabledAdmin", data: "N/A" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "bank", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "bank", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "phone", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "phone", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "defaultdiv", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defaultdiv", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "defaultjoin", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defaultjoin", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "defaultleader", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "defaultleader", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 0, field_name: "budget", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "budget", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "fid", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "fid", data: "2" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "type", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "type", data: "3" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "locale", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "locale", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "parent", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "parent", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "abbr", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "abbr", data: "TestLE" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "title", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "title", data: "Test Law Enforcement" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "disabled", connection: 1, max_len: 14 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "disabled", data: "0" [09:08:24] [DEBUG] cache_get_field_content - row: 1, field_name: "disabledReason", connection: 1, max_len: 1 [09:08:24] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "disabledReason", data: "N/A" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "disabledAdmin", connection: 1, max_len: 1 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "disabledAdmin", data: "N/A" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "bank", connection: 1, max_len: 14 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "bank", data: "0" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "phone", connection: 1, max_len: 14 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "phone", data: "0" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "defaultdiv", connection: 1, max_len: 14 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "defaultdiv", data: "0" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "defaultjoin", connection: 1, max_len: 14 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "defaultjoin", data: "0" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "defaultleader", connection: 1, max_len: 14 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "defaultleader", data: "0" [09:08:25] [DEBUG] cache_get_field_content - row: 1, field_name: "budget", connection: 1, max_len: 14 [09:08:25] [DEBUG] CMySQLResult::GetRowDataByName - row: '1', field: "budget", data: "0" [09:08:25] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [09:08:25] [DEBUG] Calling callback "OnQueryFinish".. [09:08:25] [DEBUG] cache_get_data - connection: 1 [09:08:25] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [09:08:25] [DEBUG] Calling callback "OnQueryFinish".. [09:08:25] [DEBUG] cache_get_data - connection: 1 [09:08:25] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called
Код:
[09:08:24] Loading Factions... [09:08:24] Loading Faction Ranks... [09:08:24] Loading Faction Divisions... [09:08:24] Filterscript 'Factions.amx' loaded. [09:08:24] Rows Detected. [09:08:24] [Slot 1] Loaded. [09:08:25] [Slot 2] Loaded.