28.12.2008, 12:10
I'm making an admin script with SA MP MySQL plugin. The old version (v0.1), didn't work good (It crashed a lot), i thought the new version (v0.13) works better, but it isn't the best too. With the old version i could reload my script, but with the new version i can't do that. Is anybody know about a new plugin version or libmysql.dll, which working stable? What libmysql.dll is good? I copied that from mysql server folder next to samp-server.exe.
Example:
- I use this to load admin commands from database, and when i reload my fs it crashes
Please, help me!
Sorry, for my bad english, but i'm from Hungary
.
Example:
- I use this to load admin commands from database, and when i reload my fs it crashes
Код:
public OnFilterScriptInit() { #if defined SQL_HOST print("+------------------------+"); print("| mySQL Admin Script |"); print("| by |"); print("| [HuN]Peti |"); print("+------------------------+"); samp_mysql_connect(SQL_HOST, SQL_USER, SQL_PASS); if(samp_mysql_ping()==0) { printf("[SQLAdmin] Connection to database is alive!"); } else { printf("[SQLAdmin] Can't connect to database with host: %s", SQL_HOST); } samp_mysql_select_db(SQL_DB); NullAllVariables(); printf("[SQLAdmin] Loading Admin Commands' accesses..."); <== LoadCmdAccesses(); printf("[SQLAdmin] Creating Timers..."); SetTimer("CheckPings", 5000, true); printf("[SQLAdmin] Creating Menus..."); CreateMenus(); printf("[SQLAdmin] Loading Configs..."); LoadConfigs(); printf("[SQLAdmin] Loading Forbidden Names..."); LoadForbidNames(); #endif } new CmdAccesses[MAX_CMDS][cmdEnum]; stock LoadCmdAccesses() { new line[256], field[128], i=0; CheckSQLConnection(); samp_mysql_query("SELECT * FROM cmds"); // Fields: Level, CMD samp_mysql_store_result(); while(samp_mysql_fetch_row(line)) { samp_mysql_strtok(field, "|", line); CmdAccesses[i][LvLNeed] = strval(field); samp_mysql_strtok(field, "|", ""); format(CmdAccesses[i][CMD], 256, field); i++; } samp_mysql_free_result(); return false; }
Sorry, for my bad english, but i'm from Hungary
![Cheesy](images/smilies/biggrin.png)