CodX Posted August 26, 2017 Share Posted August 26, 2017 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. Link to comment
Rockyz Posted August 26, 2017 Share Posted August 26, 2017 https://community.multitheftauto.com/index.php?p=resources&s=details&id=6954 Link to comment
Tails Posted August 27, 2017 Share Posted August 27, 2017 https://wiki.multitheftauto.com/wiki/FadeCamera Link to comment
CodX Posted August 27, 2017 Author Share Posted August 27, 2017 5 hours ago, Tails said: https://wiki.multitheftauto.com/wiki/FadeCamera 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
Mr.Loki Posted August 27, 2017 Share Posted August 27, 2017 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 1 Link to comment
CodX Posted August 27, 2017 Author Share Posted August 27, 2017 (edited) Doesn't work.. The backround is the same. Edited August 27, 2017 by CodX Link to comment
Mr.Loki Posted August 27, 2017 Share Posted August 27, 2017 Can you past the whole code please? Link to comment
CodX Posted August 27, 2017 Author Share Posted August 27, 2017 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 1 Link to comment
Mr.Loki Posted August 27, 2017 Share Posted August 27, 2017 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 1 Link to comment
CodX Posted August 27, 2017 Author Share Posted August 27, 2017 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
Master_MTA Posted August 27, 2017 Share Posted August 27, 2017 (edited) 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 August 27, 2017 by Master_MTA Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now