Skream

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Skream

  • Rank
    Vic
  1. Is there any better version of object preview? I want to print all skins (I have custom ones) but some of then doesn't render well. I'm using this resource https://wiki.multitheftauto.com/wiki/Resource:Object_preview this is my lua code based on wiki -- -- c_main.lua -- local scx, scy = guiGetScreenSize () local myObject,myElement, guiWindow = nil, nil, nil local myRotation = {0,0,180} local mySkin = 0 addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource()), function() outputChatBox('Use num keys to rotate the object') local x1, y1, z1 = getCameraMatrix() myElement = createPed(mySkin, 1760.5491, -1950.9703, 14.1096) myObject = exports.object_preview:createObjectPreview(myElement,0,0,180,1,1,1,1,true,false,true) guiWindow = guiCreateWindow(0, 0,400,400,"Test area",false,false) guiSetAlpha(guiWindow, 0.05 + 0.2) local projPosX, projPosY = guiGetPosition(guiWindow,true) local projSizeX, projSizeY = guiGetSize(guiWindow, true) bindKey ( "p", "down", function() for i = mySkin + 1, 312 do if isValidSkin(i) == 1 then mySkin = i setElementModel(myElement, mySkin) break end end end ) bindKey ( "i", "down", function() setElementModel(myElement, mySkin) end ) bindKey ( "o", "down", function() exports.object_preview:saveRTToFile(myObject, "skins/"..mySkin..".png") end) end) addEventHandler("onClientRender", root, function() if myObject then local projPosX, projPosY = guiGetPosition(guiWindow,true) local projSizeX, projSizeY = guiGetSize(guiWindow, true) exports.object_preview:setRotation(myObject,myRotation[1], myRotation[2], myRotation[3]) exports.object_preview:setProjection(myObject,projPosX, projPosY, projSizeX, projSizeY, true, true) end end) addEventHandler("onClientResourceStop", getResourceRootElement( getThisResource()), function() exports.object_preview:destroyObjectPreview(myObject) end ) function isValidSkin( specifiedSkin ) -- Define the function local result = false -- Define result, it is currently false if ( specifiedSkin ) then -- If skin specified local allSkins = getValidPedModels ( ) -- Get valid skin IDs for key, skin in ipairs( allSkins ) do -- Check all skins if skin == tonumber( specifiedSkin ) then -- If skin equals specified one, it is valid result = 1 -- So set it as result break --stop looping through a table after we found the skin end end end return result end
  2. CEF - audio

    mp3/sounds in CEF <audio id="intro" controls autoplay loop hidden=true> <source src="sounds/intro.mp3" type="audio/mpeg"> </audio> nothing happens in-game. It works pretty well if I open it in my browser but I get nothing ingame I tried to play it with JS but still nothing happens screenW, screenH = guiGetScreenSize() webBrowser = guiCreateBrowser(0, 0, screenW, screenH, true, true, false) theBrowser = guiGetBrowser(webBrowser) addEventHandler("onClientBrowserCreated", theBrowser, function() loadBrowserURL(theBrowser, "http://mta/rio-login/index.html") setBrowserVolume(theBrowser, 1); showCursor(true) fadeCamera(false) showChat(false) end ) this is my lua code and everything works alright except playing sounds. nothing happens with setBrowserVolume either I know I can play the intro ingame k no problem about that but how can it would be hard to call a mta.trigger everytime I need to use a sound for hover or click
  3. fetchRemote - Empty formfields

    solved
  4. fetchRemote - Empty formfields

    I get a attempt to my php server but the formfields are empty there postData = { queueName = "só de borest", connectionAttempts = 3, connectTimeout = 5000, formFields = { login_username = "kitgay", login_password = "naminhaescolanao", login_email = "jbolsonaro@gmail.com", }, } fetchRemote("myurl", postData, function(data, info) outputDebugString( "wiki based attempt" .. " success:" .. tostring(info.success) .. " statusCode:" .. tostring(info.statusCode) .. " data:" .. tostring(data) ) end ) xml is <min_mta_version server="1.5.4-9.11413" client="1.3.2" />
  5. Whats wrong with it

    still not working its like the resource never started and yes it is getting download and my xml look ok. I just have that resource and my mysql connection
  6. Whats wrong with it

    I'm trying to do a login but when I connect I just get black screen local screenWidth, screenHeight = guiGetScreenSize() addEventHandler("onClientResourceStart", localPlayer, function() loginGUI.background = guiCreateStaticImage(0, 0, 1920, 1200, "background.png", false) loginGUI.font = guiCreateFont("Roboto-Thin.ttf", 10) loginGUI.windowLogin = guiCreateStaticImage((screenWidth - 238) / 2, (screenHeight - 184) / 2, 238, 184, "images/login.png", false) loginGUI.loginUsername = guiCreateEdit(15, 30, 238, 36, "Usuário ou E-mail", false, loginGUI.windowLogin) loginGUI.loginPassword = guiCreateEdit(15, 69, 238, 36, "Senha", false, loginGUI.windowLogin) guiEditSetMaxLength(loginGUI.loginUsername, 64) guiEditSetMaxLength(loginGUI.loginPassword, 32) guiEditSetMasked(loginGUI.loginPassword, true) guiSetFont(loginGUI.loginUsername, loginGUI.font) guiSetFont(loginGUI.loginPassword, loginGUI.font) guiLabelSetHorizontalAlign(loginGUI.loginUsername, "right") guiLabelSetHorizontalAlign(loginGUI.loginPassword, "right") loginGUI.windowReg = guiCreateStaticImage((screenWidth - 238) / 2, (screenHeight - 223) / 2, 0, 0, 238, 223, "images/register.png", false) loginGUI.regUsername = guiCreateEdit(15, 30, 238, 36, "Usuário", false, loginGUI.windowReg) loginGUI.regPassword = guiCreateEdit(15, 69, 238, 36, "Senha", false, loginGUI.windowReg) loginGUI.regEmail = guiCreateEdit(15, 108, 238, 36, "E-mail", false, loginGUI.windowReg) guiEditSetMaxLength(loginGUI.regUsername, 22) guiEditSetMaxLength(loginGUI.regPassword, 32) guiEditSetMaxLength(loginGUI.regEmail, 64) guiEditSetMasked(loginGUI.regPassword, true) guiSetFont(loginGUI.regUsername, loginGUI.font) guiSetFont(loginGUI.regPassword, loginGUI.font) guiSetFont(loginGUI.regEmail, loginGUI.font) guiLabelSetHorizontalAlign(loginGUI.regUsername, "right") guiLabelSetHorizontalAlign(loginGUI.regPassword, "right") guiLabelSetHorizontalAlign(loginGUI.regEmail, "right") showLogin() introMusic = playSound("sounds/intro.mp3", true) setSoundVolume(soundIntro, 0.7) triggerEvent("onAccountRegister", hideEverything()) triggerEvent("onAccountLogin", hideEverything()) end ) function showLogin() guiSetVisible(loginGUI.background, true) guiSetVisible(loginGUI.windowLogin, true) guiSetVisible(loginGUI.windowReg, false) showChat(false) showCursor(true) end