E-mail Posted August 27, 2011 Posted August 27, 2011 Hi all the script works fine but i want it Disappear After 10 sec.... The Code ! local rootElement = getRootElement() local screenWidth,screenHeight = guiGetScreenSize() function renderDisplay ( ) local seconds = getTickCount() / 1000 local angle = math.sin(seconds) * 80 dxDrawImage ( screenWidth/2 - 50, 0, 642, 204, 'b_logo.png', angle, 0, -120 ) end function HandleTheRendering ( ) addEventHandler("onClientRender",rootElement, renderDisplay) end addEventHandler("onClientResourceStart",resourceRoot, HandleTheRendering)
JR10 Posted August 27, 2011 Posted August 27, 2011 setTimer ( function ( ) removeEventHandler("onClientRender",rootElement, renderDisplay) end , 10000 , 1 )
E-mail Posted August 27, 2011 Author Posted August 27, 2011 Thx JR10 Thank you very much You are the best person in the Forum Assistant I wish you success in the future Nice to have someone Like you
CapY Posted August 31, 2011 Posted August 31, 2011 The same thing like with logo , means label starts onPlayerJoin and disappears for 5 secs.
Castillo Posted August 31, 2011 Posted August 31, 2011 Well, what he's using is DX drawing, you could use dxDrawText and copy the way he'd it.
CapY Posted August 31, 2011 Posted August 31, 2011 I already done this , but that will not work , because like you said i dont have dxDrawText . Here : local rootElement = getRootElement() local screenWidth,screenHeight = guiGetScreenSize() GUIEditor_Label = {} GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") addEventHandler("onPlayerJoin", rootElement,GUIEditor_Label[1]) end) setTimer ( GUIEditor_Label[1], guiSetVisible(GUIEditor_Label, false ,rootElement) end , 5000 , 1 ) Yep and there is an error on 12 line , but that will not work anyway.
Castillo Posted August 31, 2011 Posted August 31, 2011 local screenWidth,screenHeight = guiGetScreenSize() GUIEditor_Label = {} addEventHandler("onClientResourceStart",resourceRoot, function () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") end) setTimer ( guiSetVisible, 5000, 1, GUIEditor_Label, false) You had MANY mistakes in the code, try to pay more attention.
CapY Posted August 31, 2011 Posted August 31, 2011 :14: Bad Argument @ 'setTimer' [Expected function at argument 1, got nil]
Static-X Posted August 31, 2011 Posted August 31, 2011 Use setTimer ( guiSetVisible, 5000, 1, GUIEditor_Label[1], false)
CapY Posted August 31, 2011 Posted August 31, 2011 local screenWidth,screenHeight = guiGetScreenSize() GUIEditor_Label = {} function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") setTimer ( GUIEditor_Label[1], 5000, 1, guiSetVisible, false) end addEventHandler("onClientResourceStart",getRootElement(), lol ) EDIT : I FIXED IT
Castillo Posted August 31, 2011 Posted August 31, 2011 You put it vice versa. local screenWidth,screenHeight = guiGetScreenSize() GUIEditor_Label = {} function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") setTimer ( guiSetVisible, 5000, 1, GUIEditor_Label[1], false) end addEventHandler("onClientResourceStart",getRootElement(), lol )
CapY Posted August 31, 2011 Posted August 31, 2011 Bad argument on line 12 Here : local screenWidth,screenHeight = guiGetScreenSize() GUIEditor_Label = {} function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") fadeCamera(lol, false, 1.0,0,0,0) setTimer( fadeCamera, 10000, 1,GUIEditor_Label[1], false) setTimer ( guiSetVisible, 10000, 1, GUIEditor_Label[1], false) end addEventHandler("onClientResourceStart",getRootElement(), lol )
Static-X Posted August 31, 2011 Posted August 31, 2011 wtf fadeCamera for a label? GUIEditor_Label = {} function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") fadeCamera(false,1.0) setTimer( fadeCamera, 10000,1,true) setTimer ( guiSetVisible, 10000, 1, GUIEditor_Label[1], false) end addEventHandler("onClientResourceStart",getRootElement(), lol )
CapY Posted August 31, 2011 Posted August 31, 2011 FadeCamera dont works when player joins. EDIT: Why everytime when i restart any resource that label shows up ?
Static-X Posted August 31, 2011 Posted August 31, 2011 Use this handler addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),lol)
CapY Posted September 1, 2011 Posted September 1, 2011 Okay, but fadeCamera doesnt works still on join , it works just when i restart resource . GUIEditor_Label = {} fadeCamera = true function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") fadeCamera(true,5.0) setTimer( fadeCamera, 10000,1,true) setTimer ( guiSetVisible, 10000, 1, GUIEditor_Label[1], false) end addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),lol)
Castillo Posted September 1, 2011 Posted September 1, 2011 onClientResourceStart is triggered when the player finishes downloading the resources, maybe you should do it server-side onPlayerJoin to fade camera.
CapY Posted September 1, 2011 Posted September 1, 2011 No errors , but script doesnt works . Client: GUIEditor_Label = {} function lol () GUIEditor_Label[1] = guiCreateLabel(0.4063,0.3779,0.1531,0.209,"Welcome to our server ! Server is under construction at the moment , but feel free to play on it , expect more gamemodes from us , more features and much , much more ...",true) guiLabelSetColor(GUIEditor_Label[1],0,255,0) guiLabelSetVerticalAlign(GUIEditor_Label[1],"center") guiLabelSetHorizontalAlign(GUIEditor_Label[1],"center",true) guiSetFont(GUIEditor_Label[1],"clear-normal") fadeCamera(false,1.0) setTimer( fadeCamera, 10000,1,true) setTimer ( guiSetVisible, 10000, 1, GUIEditor_Label[1], false) triggerClientEvent("blurFade",getRootElement(),lol) end Server: local fadeCamera = true function fade() fadeCamera(false,10.0) end addEventHandler("onPlayerJoin",getRootElement(),fade) addEvent( "blurFade",true ) addEventHandler("blurFade",getRootElement(),fade)
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