Jaysds1 Posted March 17, 2011 Posted March 17, 2011 I need help creating a button linking to a team, making a person/client spawn on that team. 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/
Castillo Posted March 17, 2011 Posted March 17, 2011 --client side function selectTeam() triggerServerEvent("setTeam",getLocalPlayer()) end addEventHandler("onClientGUIClick",yourButtonElement,selectTeam,false) --server side addEvent("setTeam",true) addEventHandler("setTeam",getRootElement(), function () setPlayerTeam" class="kw6">setPlayerTeam(source,getTeamFromName("Some_Team")) outputChatBox("Your team has been set!", source) end) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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/
Jaysds1 Posted April 29, 2011 Author Posted April 29, 2011 How do you connect this to the spawn window with the 2 buttons 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/
Castillo Posted April 30, 2011 Posted April 30, 2011 yourButtonElement = guiCreateButton(blabla) You will have something else, that's why i put yourButtonElement for you to change it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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