AMX Mod X API Documentation

Signature
native SQL_ThreadQuery(Handle:db_tuple, const handler[], const query[], const data[] = "", dataSize = 0);
Description

Prepares and executes a threaded query.

Notes
  • The handler should look like:

    public QueryHandler(failstate, Handle:query, error[], errnum, data[], size, Float:queuetime)

    failstate - One of the three TQUERY_ defines.

    query - Handle to the query, do not free it.

    error - An error message, if any.

    errnum - An error code, if any.

    data - Data array you passed in.

    size - Size of the data array you passed in.

    queuetime - Amount of gametime that passed while the query was resolving.

  • This will not interrupt gameplay in the event of a poor/lossed

    connection, however, the interface is more complicated and

    asynchronous. Furthermore, a new connection/disconnection is

    made for each query to simplify driver support.

  • The handle does not need to be freed.
Parameters
  • db_tuple Tuple handle, returned from SQL_MakeDbTuple().
  • handler A function to be called when the query finishes. It has to be public.
  • query The query string.
  • data Additional data array that will be passed to the handler function.
  • dataSize The size of the additional data array.
No return value
Errors
  • Thread worker was unable to start.

    Invalid info tuple handle.

    Handler function not found.

Назад
Верх