Jump to content

BackRound colors


CodX

Recommended Posts

5 hours ago, Tails said:

I've put that in script but didn't work.

function playerWasted (thePlayer)
	deathSound = playSound("deathFX/wasted.mp3",false)
	setSoundVolume(deathSound, 50)
	setGameSpeed (0.1)
        setTimer ( function()
		fadeCamera ( thePlayer, true, 1.0, 224, 224, 224 )
	end, 10000, 1 )
end

On fadeCamer he give me warning when the player was respawn who says "got boolean".

Link to comment

You are using the Server sided version of the function the client side does not need the player argument.

function playerWasted (thePlayer)
	deathSound = playSound("deathFX/wasted.mp3",false)
	setSoundVolume(deathSound, 50)
	setGameSpeed (0.1)
	fadeCamera ( false, 2, 127.5, 127.5, 127.5 )
		setTimer ( function()
		fadeCamera ( true, 1 )
	end, 5000, 1 )
end
  • Like 1
Link to comment
1 minute ago, Mr.Loki said:

Can you past the whole code please?

local deathSound = nil
local ckSound = nil

function playerWasted (thePlayer)
        fadeCamera ( false, 10, 255, 0, 0 )
        setTimer ( function()
        fadeCamera ( true, 1 )
    end, 10000, 1 )
    deathSound = playSound("deathFX/wasted.mp3",false)
    setSoundVolume(deathSound, 50)
    setGameSpeed (0.1)
end
addEventHandler ( "onClientPlayerWasted", getLocalPlayer(), playerWasted )

function playerSpawn()
    if deathSound and isElement(deathSound) then
        destroyElement(deathSound)
    end
    setGameSpeed (1)
end
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), playerSpawn )

local gui = {}
function showCkWindow()
    triggerServerEvent("updateCharacters", localPlayer)
    setTimer(function()
        triggerEvent("accounts:logout", localPlayer)
        setGameSpeed (1)
        closeCkWindow()
        ckSound = playSound("deathFX/cked.mp3",false)
        setSoundVolume(ckSound, 0.4)
        triggerEvent("es-system:closeRespawnButton", localPlayer)
        gui.window = guiCreateStaticImage(0, 0, 350, 300, ":resources/window_body.png", false)
        exports.global:centerWindow(gui.window)
        gui.label = guiCreateLabel(0.05, 0.05, 0.9, 0.7, string.gsub(getPlayerName(localPlayer), "_", " ").." a primit CK!\n\nCK (Character Kill) este modul cel mai neobiÈ™nuit prin care un caracter este ucis È™i este folosit doar în situaÈ›ii în care este strict necesar. \n\nCând eÈ™ti ucis prin această modalitate (CK), este permanent È™i singura metodă de a primi bunurile caracterului este de a crea un alt caracter care este rudă cu vechiul caracter (acelaÈ™i nume de familie) È™i este anunÈ›at un administrator pentru primirea bunurilor (character transfer).\n\nAcum vei fii redirecÈ›ionat la panoul de selectare a caracterelor deoarece este singura opÈ›iune care o mai ai.", true, gui.window)
        guiLabelSetHorizontalAlign(gui.label, "left", true)
        guiLabelSetVerticalAlign(gui.label, "center", true)
        gui.bClose = guiCreateButton(0.05, 0.8, 0.9, 0.15, "OK", true, gui.window)
        addEventHandler("onClientGUIClick", gui.bClose,
        function ()
            if source == gui.bClose then
                closeCkWindow()
            end
        end, false)
    end, 2000, 1)
end
addEvent("showCkWindow", true)
addEventHandler ( "showCkWindow", localPlayer, showCkWindow )

function closeCkWindow()
    if gui.window and isElement(gui.window) then
        destroyElement(gui.window)
    end
end

 

Wait, it work !

I;ve set game speed and now is good.

The color wasn't placed because the game speed was to slow.

 

P.S: Sorry for my english if isn't correctly.

 

Thanks you for help ! :) #Like

  • Thanks 1
Link to comment
2 minutes ago, Mr.Loki said:

If you slow the game speed the speed of the fade is also slowed and you had 10 seconds ._. so the fade time would have been 10*10

so set the fade time to 0.1

Now, i've see that :)

I.ve set fade to 0.8.

Thanks you again for help !

Link to comment
On ٢٦‏/٨‏/٢٠١٧ at 21:15, CodX said:

Hello ! It's posibble to set backrounds gray when a player die and then to normal when is respawned ?

If is posible, how can i do that ?

I need that for another script.

fadeCamera(plr,false,1,65,65,65)

 

and when he spawn do something like that

addEventHandler('onPlayerSpawn',root,function()
    fadeCamera(source.true)
  end)

 

Edited by Master_MTA
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...