Log in to reply
 

coding??!



  • im making an ingame mod, and i was thinking if this would make the game read the licenses from my sql database, with this code?

    RegisterNetEvent function CheckLicense(target, type, cb)
    local identifier = GetPlayerIdentifier(target, 0)

    MySQL.Async.fetchALL('SELECT COUNT(*) as count FROM user_license WHERE type = @type AND owner = @owner', {
    	['@type'] 	= type,
    	['@owner']	= identifier
    }, function(result)
    	if tonumber(result[1].count) > 0 then
    		cb(true)
    	else
    		cb(false)
    	end
    end)
    

    end



  • I'm guessing you're making a FiveM mod, since that is the syntax for this FiveM MySQL library: https://github.com/brouznouf/fivem-mysql-async/blob/master/example.lua

    We are mainly a SP modding community. You may get more/better help over on the FiveM forums: https://forum.cfx.re/


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.