NotBad5 / notbad-save-health-armour

Simple script coded in lua for FiveM, saves health and armour when disconnecting and sets health and armour when connecting
GNU General Public License v3.0
15 stars 7 forks source link

SQL Error #1

Open skylord-ez opened 1 year ago

skylord-ez commented 1 year ago

image

I'm facing this error. How to fix this?

pvtoari commented 1 year ago

The error is that the identifier used (license) is very long to be managed by the SQL script. Try using other identifier such as the in-game name or steam hex. Here's an example:

for k, v in ipairs(GetPlayerIdentifiers(src)) do
        if string.sub(v, 1, string.len("steam:")) == "steam:" then
            identifier = v
        end
    end

    if identifier == nil then return end
skylord-ez commented 1 year ago

But I'm using esx legacy framework which supports identifier. Is there any other way to increase the value of that data?

NotBad5 commented 1 year ago

Delete current table notbad_health_armour and try this:

CREATE TABLE IF NOT EXISTS `notbad_health_armour` (
    `identifier` VARCHAR(255) NOT NULL,
    `status` VARCHAR(255) NULL DEFAULT NULL,
    PRIMARY KEY (`identifier`)
);