Jaysds1 Posted March 17, 2011 Posted March 17, 2011 (edited) What should I edited in here? I created a gui with 2 buttons that should be linked to spawning a player. addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Progress = {} GUIEditor_Window[1] = guiCreateWindow(33,174,149,276,"Teams",false) guiSetAlpha(GUIEditor_Window[1],1) GUIEditor_Button[2] = guiCreateButton(46,172,67,31,"Freeroamer",false,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Button[2],1) GUIEditor_Edit[1] = guiCreateEdit(36,39,92,43,"Select a Team",false,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Edit[1],1) guiEditSetReadOnly(GUIEditor_Edit[1],true) GUIEditor_Progress[1] = guiCreateProgressBar(24,238,112,29,false,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Progress[1],1) guiProgressBarSetProgress(GUIEditor_Progress[1],100) end ) Edited July 7, 2011 by Guest My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
proracer Posted March 17, 2011 Posted March 17, 2011 (edited) If you want to trigger function when player spawns use this: https://wiki.multitheftauto.com/wiki/OnClientPlayerSpawn Edit: Sorry, I understood wrong. Edited March 17, 2011 by Guest
Moderators Citizen Posted March 17, 2011 Moderators Posted March 17, 2011 you have to add this event onClientGUIClick after the creation of your 2 buttons ( and where is your 1st button ? ^^ ): function spawnFreeroamer() outputChatBox("Spawn Freeroamer" ) -- you can hide your windows: guiSetVisible( GUIEditor_Window[1], false ) end addEventHandler("onClientResourceStart",resourceRoot, function() GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Edit = {} GUIEditor_Progress = {} GUIEditor_Window[1] = guiCreateWindow(33,174,149,276,"Teams",false) guiSetAlpha(GUIEditor_Window[1],1) GUIEditor_Button[2] = guiCreateButton(46,172,67,31,"Freeroamer",false,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Button[2],1) GUIEditor_Edit[1] = guiCreateEdit(36,39,92,43,"Select a Team",false,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Edit[1],1) guiEditSetReadOnly(GUIEditor_Edit[1],true) GUIEditor_Progress[1] = guiCreateProgressBar(24,238,112,29,false,GUIEditor_Window[1]) guiSetAlpha(GUIEditor_Progress[1],1) guiProgressBarSetProgress(GUIEditor_Progress[1],100) -- execute spawnFreeroamer() if the GUIEditor_Button[2] is clicked: addEventHandler ( "onClientGUIClick", GUIEditor_Button[2], spawnFreeroamer, false ) end ) The rEvolution is coming ...
Jaysds1 Posted March 17, 2011 Author Posted March 17, 2011 THANKS My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
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