denny199 Posted February 27, 2012 Share Posted February 27, 2012 Hey there, i was making a new gamemode but now i got a error @ setPlayerTeam Using triggering, but i got a error when i double click on the image, works, but setPlayerTeam is not working I want that the player who clicked on the Image gets in that team. Client lp = getLocalPlayer () -- u don't need gui stuff function maaskantje (player) outputChatBox ( "Maaskantje" ) showCursor ( false ) triggerServerEvent( 'maaskantjeteam',lp ) end addEventHandler ( "onClientGUIDoubleClick", GUIEditor_Image[2], maaskantje) function schijndel (player) outputChatBox ( "Schijndel" ) showCursor ( false ) triggerServerEvent( 'schijndelteam',lp ) end addEventHandler ( "onClientGUIDoubleClick", GUIEditor_Image[3], schijndel) Server function createTeamsOnStart () maaskantje = createTeam ( "Maaskantje", 250, 0, 0 ) schijndel = createTeam ( "Schijndel", 0, 0, 255 ) end addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), createTeamsOnStart ) function maaskantje (source, maaskantje) setPlayerTeam ( source,getTeamFromName( 'Maaskantje' ) ) setElementModel ( source, 280 ) end addEvent ( "maaskantjeteam", true ) addEventHandler ( "maaskantjeteam", root, maaskantje ) function schijndel ( source, schijndel ) setPlayerTeam ( source,getTeamFromName( 'Schijndel' ) ) setElementModel ( source, 280 ) end addEvent ( "schijndelteam", true ) addEventHandler ( "schijndelteam", root, schijndel ) Thanks. Link to comment
Kenix Posted February 27, 2012 Share Posted February 27, 2012 (edited) Server local maaskantje = createTeam ( "Maaskantje", 250, 0, 0 ) local schijndel = createTeam ( "Schijndel", 0, 0, 255 ) function maaskantje ( ) setPlayerTeam ( source,getTeamFromName( 'Maaskantje' ) ) setElementModel ( source, 280 ) end addEvent ( "maaskantjeteam", true ) addEventHandler ( "maaskantjeteam", root, maaskantje ) function schijndel ( ) setPlayerTeam ( source,getTeamFromName( 'Schijndel' ) ) setElementModel ( source, 280 ) end addEvent ( "schijndelteam", true ) addEventHandler ( "schijndelteam", root, schijndel ) You not need add source to arguments event handler function, because source already have in event and you replace with nil. Client function maaskantje ( ) outputChatBox ( "Maaskantje" ) showCursor ( false ) triggerServerEvent( 'maaskantjeteam',localPlayer ) end addEventHandler ( "onClientGUIDoubleClick", GUIEditor_Image[2], maaskantje ) function schijndel ( ) outputChatBox ( "Schijndel" ) showCursor ( false ) triggerServerEvent( 'schijndelteam',localPlayer ) end addEventHandler ( "onClientGUIDoubleClick", GUIEditor_Image[3], schijndel ) Variables GUIEditor_Image[2],GUIEditor_Image[3] defined? Edited February 27, 2012 by Guest Link to comment
denny199 Posted February 27, 2012 Author Share Posted February 27, 2012 Thank you working, u can close this Link to comment
Kenix Posted February 27, 2012 Share Posted February 27, 2012 (edited) No problem. u can close this I can't. I not have rights for close this topic. Edited February 27, 2012 by Guest Link to comment
Castillo Posted February 27, 2012 Share Posted February 27, 2012 Thank you working, u can close this Why close the topic? someone else may have a similar problem. 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