nowofresh Posted December 16, 2010 Share Posted December 16, 2010 Hey, I am going to create like that: Player connect with a my sever. => Show 1 picture (5 sec) =>Show 2 picture (10sec) =>Show window in gui . function pokazlogo(x,y,width,height,path,relative,thefunction,time,Interval, TimesToExecute) guiCreateStaticImage( 0, 0, 1300, 1000, "img/pokazlogo.png", false ) setTimer ( pokazwczytywanie, 50, 1) --OutputChatBox("Zrobione...") end addEventHandler( "onResourceStart", getResourceRootElement( getThisResource() ), pokazlogo ) function pokazwczytywanie(x,y,width,height,path,relative,thefunction,time,Interval, TimesToExecute) guiCreateStaticImage( 0, 0, 1300, 1000, "img/pokazwczytywanie.png", false ) setTimer ( pokazlogowanie, 50, 1) end addEventHandler( "onResourceStart", rootElement, pokazwcztytywanie ) Link to comment
Arran Posted December 16, 2010 Share Posted December 16, 2010 onResourceStart is server side only. Change them to onClientResourceStart. Link to comment
nowofresh Posted December 17, 2010 Author Share Posted December 17, 2010 function pokazlogo() guiCreateStaticImage( 0, 0, 1200, 1500, "img/pokazlogo.png", false ) end addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ), pokazlogo ) What wrong ? Picture cant work Link to comment
Arran Posted December 17, 2010 Share Posted December 17, 2010 I see nothing wrong there. So its either img/pokazlogo.png is not there or its not put in the meta.xml ( ) Link to comment
nowofresh Posted December 17, 2010 Author Share Posted December 17, 2010 I cant see fucking picture. <meta> <info author="NL team" version="1.0" type="gamemode" /> <script src="n_polaczenie/login_c.lua" type="client" /> <file src="n_polaczenie/img/pokazlogo.png" /> </meta> Link to comment
Aibo Posted December 17, 2010 Share Posted December 17, 2010 file path should be relative to your resource folder, not "resources" folder. assuming that your resource is "n_polaczenie": <meta> <info author="NL team" version="1.0" type="gamemode" /> <script src="login_c.lua" type="client" /> <file src="img/pokazlogo.png" /> </meta> and if "n_polaczenie" is not your resource, but a folder IN your resource, then you need to specify it in guiCreateStaticImage(). basically, paths should be the same in meta and script. Link to comment
nowofresh Posted December 17, 2010 Author Share Posted December 17, 2010 [list=]Thanks, gays. Working great. Link to comment
nowofresh Posted December 18, 2010 Author Share Posted December 18, 2010 How to play music in the background "onClientResourceStart" ? function playmusic() local sound = playSound("n_polaczenie/snds/tlo.mp3", false) setSoundVolume(sound, 1.0) end addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() , playmusic) Can't work Link to comment
Castillo Posted December 18, 2010 Share Posted December 18, 2010 do you have the sound file in meta.xml? Link to comment
nowofresh Posted December 18, 2010 Author Share Posted December 18, 2010 yee <file src="n_polaczenie/snds/tlo.mp3" /> </meta> Link to comment
Castillo Posted December 18, 2010 Share Posted December 18, 2010 try this, without function should do the same job i think. local sound = playSound("n_polaczenie/snds/tlo.mp3", false) setSoundVolume(sound, 1.0) Link to comment
Aibo Posted December 18, 2010 Share Posted December 18, 2010 same thing, if "n_polaczenie" is your resource — dont specify it's name in relative file path. Link to comment
nowofresh Posted December 18, 2010 Author Share Posted December 18, 2010 It is a, rescources/nl/n_polaczenie What problem ? Link to comment
_______ Posted December 18, 2010 Share Posted December 18, 2010 gays.[/b]Working great. lol Link to comment
Aibo Posted December 18, 2010 Share Posted December 18, 2010 addEventHandler("onClientResourceStart", getResourceRootElement( getThisResource() , playmusic) you have ) missing after getThisResource(). Link to comment
milkshake333 Posted December 18, 2010 Share Posted December 18, 2010 And remove "n_polaczenie/" from the playSound function... Link to comment
Castillo Posted December 19, 2010 Share Posted December 19, 2010 gays.[/b]Working great. lol Off-topic: lol, i didn't noticed of that. 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