Hello, i'm trying to build a Roleplay gamemode from almost 0, I only have a MYSQL resource who exports functions
so, i have this code
mysql = exports.mysql
chat = outputChatBox
function greetPlayer (thePlayer )
serial = getPlayerSerial(source)
mysql:query_free("INSERT INTO serial SET seriala='" .. serial .. "'")
end
addEventHandler ( "onPlayerJoin", getRootElement(), greetPlayer )
how cand I verify if the serial is already in the SQL database? so that it cannot insert multiple times the same serial.
I've been looking online, and I see people using SELECT, but it's complicated and i want an explanation, so I cand understand.
guiGetScreenSize helps you to get the resolution of the player, and you cand make the math like this: sW,sH = guiGetScreenSize()
guiCreateWindow(sW*0.4,sH*0.4, 200, 200, "...", false)
and it is the same thing as using the relative version
guiCreateWindow(0.4,0.4, 0.3, 04, "...", true) **but you need to use values between 0 and 1 everywhere**
setTimer(function(player)
if (getElementData(player,"isInTurf",true)) then
if (getPlayerWantedLevel(player) > 0) then
setPlayerWantedLevel(player, 0)
end
end
end, 1000, 0)
requestBrowserDomains({ "saib-gov.tk" })
local browser = guiCreateBrowser ( 0.02, 0.02, 0.96, 0.96, true, false, true, tabExplained ) -- create browser
addEventHandler("onClientBrowserWhitelistChange", root,
function(newDomains)
if newDomains[1] == "saib-gov.tk" then
loadBrowserURL( browser, "http://www.saib-gov.tk/updates" )
end
end
)
still not working