Ok so i figgured out:
PHP Code:
stock GetMatchID()
{
new szDirectory[ 128 ];
get_configsdir( szDirectory, charsmax( szDirectory ) );
add( szDirectory, charsmax( szDirectory ), "/gameid.txt" );
new size = file_size( szDirectory, 1 )
new szLine[ 128 ], iLen;
for ( new i = 0 ; i < size ; i++ )
{
read_file( szDirectory, i, szLine, charsmax( szLine ), iLen );
}
return szLine
}
But now, i want to insert into database like that:
PHP Code:
public StartGameLIVE()
{
new szQuery[3800];
new map_name[64];
get_mapname(map_name, 63)
formatex(szQuery, 3799, "INSERT INTO `matches` (`match_id`, `map`, `played_at`, `left_score`, `right_score`, `state`, `server`, `left_team_id`, `right_team_id`, `game_id` ) VALUES ( '%s', '%s', NOW(), '0', '0', '0', '85.566.954.58', '1', '1', '3' );", GetMatchID(), map_name);
SQL_ThreadQuery( g_hTuple, "QuerySetData", szQuery);
return PLUGIN_CONTINUE;
}
But getting error on that SQL line. Any ideas?