03.03.2013, 06:45
Maxips2, there's a bug with the sizeof operator and enums used together.
Using this example enumeration, you would expect
to return something it is not going to return.
So you'll have to explicitly (as of plugin R8 or something like that) specify the 4th and 5th parameters (connection and sizeof destination) in your cache_get_row_line.
Source
I was actually thinking of releasing a plugin myself, perhaps called "Simple MySQL plugin" or something due to its stripped down nature (everything except for the cache-related and required functions are removed). Also never have I had to face a crash due to the plugin.
pawn Code:
enum e_TOP_TEN
{
FINISH_MS,
PLAYER_REGID,
PLAYER_NAME[MAX_PLAYER_NAME]
}
new raceTopTen[10][e_TOP_TEN];
pawn Code:
sizeof(raceTopTen[0][PLAYER_NAME])
So you'll have to explicitly (as of plugin R8 or something like that) specify the 4th and 5th parameters (connection and sizeof destination) in your cache_get_row_line.
pawn Code:
cache_get_row(0, 0, gServerInfo[serverHostname], 1, 64);
// or...
cache_get_row(0, 0, gServerInfo[serverHostname], .max_len=64);
I was actually thinking of releasing a plugin myself, perhaps called "Simple MySQL plugin" or something due to its stripped down nature (everything except for the cache-related and required functions are removed). Also never have I had to face a crash due to the plugin.