A3kri Posted August 5, 2013 Posted August 5, 2013 Hellow .. I made gui and i can make it visible using the F7. I want it to be visible using triggerClientEvent .. so I make onPlayerSpawn and the event gets triggered addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(166, 96, 545, 402, "credits", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.staticimage[1] = guiCreateStaticImage(16, 31, 152, 127, "banshee.png", false, GUIEditor.window[1]) end ) bindKey('F7','down', function () guiSetVisible ( GUIEditor.window[1],not guiGetVisible ( GUIEditor.window[1] ) ); showCursor ( guiGetVisible ( GUIEditor.window[1] ) ) end ) this is the client sided. function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) triggerClientEvent ( "onGreeting", getRootElement(), "Hello World!" ) --wiki end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) and this is the server sided I used wiki but couldn't get it.
OGF Posted August 5, 2013 Posted August 5, 2013 addEvent ( "startWindow", true ) addEventHandler("startWindow", root, function() GUIEditor.window[1] = guiCreateWindow(166, 96, 545, 402, "credits", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.staticimage[1] = guiCreateStaticImage(16, 31, 152, 127, "banshee.png", false, GUIEditor.window[1]) end ) -- server function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) triggerClientEvent ( "startWindow", source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) what are you trying to do with the bindKey exactly?
DNL291 Posted August 5, 2013 Posted August 5, 2013 addEvent ( "startWindow", true ) addEventHandler("startWindow", root, function() GUIEditor.window[1] = guiCreateWindow(166, 96, 545, 402, "credits", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.staticimage[1] = guiCreateStaticImage(16, 31, 152, 127, "banshee.png", false, GUIEditor.window[1]) end ) -- server function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) triggerClientEvent ( "startWindow", source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) what are you trying to do with the bindKey exactly? guiSetVisible(GUIEditor.window[1],false) Will make the window hidden. And table "GUIEditor" must be defined. Please do not PM me with scripting related question nor support, use the forums instead.
A3kri Posted August 5, 2013 Author Posted August 5, 2013 addEvent ( "startWindow", true ) addEventHandler("startWindow", root, function() GUIEditor.window[1] = guiCreateWindow(166, 96, 545, 402, "credits", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.staticimage[1] = guiCreateStaticImage(16, 31, 152, 127, "banshee.png", false, GUIEditor.window[1]) end ) -- server function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) triggerClientEvent ( "startWindow", source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) what are you trying to do with the bindKey exactly? thnx, I used your serversided function, that what I needed x.x I used F7 to show/~ the gui
Ab-47 Posted August 5, 2013 Posted August 5, 2013 addEvent ( "startWindow", true ) addEventHandler("startWindow", root, function() GUIEditor.window[1] = guiCreateWindow(166, 96, 545, 402, "credits", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.staticimage[1] = guiCreateStaticImage(16, 31, 152, 127, "banshee.png", false, GUIEditor.window[1]) end ) -- server function player_Spawn ( posX, posY, posZ, spawnRotation, theTeam, theSkin, theInterior, theDimension ) triggerClientEvent ( "startWindow", source ) end addEventHandler ( "onPlayerSpawn", getRootElement(), player_Spawn ) what are you trying to do with the bindKey exactly? thnx, I used your serversided function, that what I needed x.x I used F7 to show/~ the gui If you do experience everyone viewing the GUI in your server, you could add an extra argument before the event. "triggerClientEvent ( "startWindow", source )" > " triggerClientEvent ( source, "startWindow", root source ) or something like that. And now Aurora is back again, pm for more info. Ex. Lead dev & L6 Staff at AUR, NGC, MTA RP & SAA. Ex. Developer at Community of Social Gamers - CSG Ex Founder of International Gaming Community - IGC and Union of Individual Players- UIP Ab-47
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