brouznouf / fivem-mysql-async

MySql Async Library for FiveM
MIT License
111 stars 106 forks source link

Might be a bug not sure #49

Closed benzon closed 6 years ago

benzon commented 6 years ago

RegisterServerEvent('esx_ambulancejob:firstSpawn') AddEventHandler('esx_ambulancejob:firstSpawn', function() local _source = source local identifier = GetPlayerIdentifiers(_source)[1] MySQL.Async.fetchScalar('SELECT isDead FROM users WHERE identifier = @identifier', { ['@identifier'] = identifier }, function(isDead) if isDead == 1 then print(('esx_ambulancejob: %s attempted combat logging!'):format(identifier)) TriggerClientEvent('esx_ambulancejob:requestDeath', _source) end end) end)

This is from esx_ambulancejob, the issue is isDead now returns a table insted of the being a single result, dont even think they noticed, but testet with 2 different versions of 3.x.x this was not a problem with 2.x.x

ghost commented 6 years ago

Yupp this is a bug. Need to check if I can fix it. If you need an immediate fix, change the column isDead to TINYINT(4).

It currently does not recognize BIT as a column value.

ALTER TABLE `users`
    CHANGE COLUMN `isDead` `isDead` TINYINT(4) NULL DEFAULT '0' AFTER `height`;
benzon commented 6 years ago

ah just did a for loop to fix it currently.

ghost commented 6 years ago

Already fixed in 3.0.8. See the closing reason.