Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/12/23 in all areas

  1. Hi, I wrote a simple form using boostrap, but when I render it to the player, the transparency option does not work. The page I show to the player is transparent until I add bootstrap to it. I've tried with version 4.0, 5.0, 5.2 but still the same problem. My HTML file: head: <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> body: <body> <div class="container d-flex justify-content-center align-items-center"> <form class="d-flex flex-column"> <div class="form-group mb-2"> <label for="username-input">Username</label> <input type="text" class="form-control" placeholder="Ur username"> </div> <div class="form-group mb-2"> <label for="password-input">Password</label> <input type="text" class="form-control" placeholder="Ur password"> </div> <button type="submit" class="btn btn-success align-self-center">Log in</button> </form> </div> </body> lua clientside: local screen_w, screen_h = guiGetScreenSize() local browser = guiCreateBrowser(0, 0, screen_w, screen_h, true, true) local theBrowser = guiGetBrowser (browser) function setURL() loadBrowserURL(source, "http://mta/local/selection-ui/index.html") showCursor(true) end addEventHandler ("onClientBrowserCreated", theBrowser, setURL) any solutions how to make it transparent with bootstrap?
    1 point
  2. Problem solved. If anyone had a problem with this: You need to remove the bootstrap styling of the body element, which overwrites the body background to #fff
    1 point
  3. I made an example maybe you can get an idea from it how it will work. If you go for toJson/fromJson if you dont have many achievements. local dbConn = dbConnect("sqlite","users.db") local users = {} achievements = {"NewOne","Top1%","TheKiller","OldOne","Nobody","NooB"} function CreateTableAchievements() dbExec(dbConn,"CREATE TABLE IF NOT EXISTS achievements (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,user TEXT,achievements TEXT)") end addEventHandler("onResourceStart",root,CreateTableAchievements) function onLogin(_,currentAcc) if currentAcc then local acc_name = getAccountName(currentAcc) if acc_name then local query = dbQuery(dbConn,"SELECT * FROM achievements WHERE user=? LIMIT 1",acc_name) local rez = dbPoll(query,-1) local data = fromJSON(rez[1]["achievements"]) if #rez == 0 then dbExec(dbConn,"INSERT INTO achievements (user) VALUES (?)",acc_name) elseif #data > 0 then users[source] = data end end end end addEventHandler("onPlayerLogin", root,onLogin) --- a coomand to give me some achievements addCommandHandler("newacv",function(player,CommandName,acv) if player then if acv ~= nil then if users[player] == nil then users[player] = {} table.insert(users[player],tonumber(acv),achievements[tonumber(acv)]) end if users[player][tonumber(acv)] == achievements[tonumber(acv)] then outputChatBox("[Achievements] You have this achievement!",player,100,250,100) else table.insert(users[player],tonumber(acv),achievements[tonumber(acv)]) outputChatBox("[Achievements] New achievement unlocked!",player,100,250,100) end end end end,false,false) addCommandHandler("saveacv",function(player,CommandName) if player then if users[player] ~= nil then local acc_name = getAccountName(getPlayerAccount(player)) dbExec(dbConn,"UPDATE achievements SET achievements=? WHERE user=?",toJSON(users[player]),acc_name) end end end,false,false)
    1 point
×
×
  • Create New...