manuelhimmler Posted June 15, 2009 Share Posted June 15, 2009 Hello guys, I wanted to see, if the functions work in my Client script, but they don't. My Client Script: function play() outputChatBox("Sound") local sound = playSound("Musik/Rocco-Everybody.mp3",true) setSoundVolume(sound,1) end addEventHandler("onClientPlayerJoin", getLocalPlayer(), play) function gui() outputChatBox("GUI") local window = guiCreateWindow(0.5,0.5,0.3,0.3,"PRPG - Login",true); local picture = guiCreateStaticImage(0.5,0.5,0.5,0.3,"Bilder/radio.gif",true,window) guiSetEnabled(window,true) guiSetVisible(window,true) showCursor(true,false) end addEventHandler("onClientPlayerJoin", getLocalPlayer(), gui) and my Meta.xml: <meta> <info author="Man1993" type="gamemode" version="0.1" name="Perfect RPG" description="Reallife Gamemode" /> <script src="prpg.lua" type="server"/> <script src="prpg_c.lua" type="client"/> <file src="Musik/Rocco-Everybody.mp3"/> <file src="Bilder/radio.gif"/> </meta> Please help me and say me what I've done wrong. Thanks!! Link to comment
50p Posted June 16, 2009 Share Posted June 16, 2009 What doesn't work? What should the code do? We need more detail to help you because we don't want to help you in the wrong direction. If you show your code and want it to spawn player and you don't tell us about it but we tell you to use different code which doesn't spawn the player, you gonna complain and keep telling us it doesn't work. We need more details to help you. Besides, use onClientResourceStart if you want to do something to the player that joins the server. Use onClientPlayerJoin if you want to do something joins but you don't want to do anything on that player's side. Link to comment
manuelhimmler Posted June 16, 2009 Author Share Posted June 16, 2009 I only want that the functions play and gui are running if the player joins ther server. I know how i can spawn the player. I only want to playe this sound file and show a window with the picture (only for testing the commands), but thank you I tried it with onClientResourceStart and it doesn't work. Sry for my bad english . Link to comment
knash94 Posted June 16, 2009 Share Posted June 16, 2009 hmm spotted somthing showCursor(true,false) Shouldnt it be showCursor( source, true) Link to comment
darkdreamingdan Posted June 17, 2009 Share Posted June 17, 2009 hmm spotted somthing showCursor(true,false) Shouldnt it be showCursor( source, true) No, its clearly a clientside script, which doesnt have a player parameter. Link to comment
50p Posted June 17, 2009 Share Posted June 17, 2009 I only want that the functions play and gui are running if the player joins ther server. I know how i can spawn the player. I only want to playe this sound file and show a window with the picture (only for testing the commands), but thank you I tried it with onClientResourceStart and it doesn't work.Sry for my bad english . Use onClientResourceStart, it must work. Don't use getLocalPlayer() for any event because the function attached to that event won't be called, use getResourceRootElement( getThisResource() ) instead.. Link to comment
manuelhimmler Posted June 17, 2009 Author Share Posted June 17, 2009 Thank you 50p! It works. 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