Skip to content

Callback Formats

imshooter edited this page Nov 29, 2026 · 1 revision

The natives that call a public take its name and a format, with a letter for each value the public receives, in order.

Letter Value
d, i an integer
f a float
b a bool
s a string, copied when the query is sent
a an array, followed by d or i with its size, both passed
r a reference to a variable, which the public may change
new MySQL:gDatabase;

forward OnRowsRead(playerid, const list[], size);

stock ReadRows(playerid) {
    new
        list[3] = { 10, 20, 30 }
    ;

    mysql_tquery(gDatabase, "SELECT 1", "OnRowsRead", "iad", playerid, list, sizeof (list));
}

public OnRowsRead(playerid, const list[], size) {
    return 1;
}

The values are captured when the native is called. A public that is not in the script, a letter that is not valid, or values that do not match the letters make the native return false.

Home

Guides

Reference

Functions

Connections
Queries
Cache
JSON cells
ORM
Queries built in pieces
Prepared statements
Batches
Transactions
Passwords
Callbacks

Clone this wiki locally