Chronos Posted June 8, 2013 Share Posted June 8, 2013 (edited) hello i have problem when i join any team http://s3.postimg.org/is114nnz7/mta_scr ... _45_55.png http://s3.postimg.org/6imlrqt5v/mta_scr ... _46_00.png http://s3.postimg.org/o64epy337/mta_scr ... _46_04.png so that my problem idk where is but i hope any one help me Edited June 9, 2013 by Guest Link to comment
Chronos Posted June 9, 2013 Author Share Posted June 9, 2013 client side: local marker = createMarker( 95.459037780762, 1923, 18.107088088989, "Cylinder", 1.5, 0, 69, 139, 0) GUIEditor_Button = {} GUIEditor_Memo = {} GUIEditor_Label = {} function guiMyCwindow(w,h,t) local x,y = guiGetScreenSize() return guiCreateWindow((x-w)/2,(y-h)/2,w,h,t,false) end windowjob = guiMyCwindow(301,250,"ArmedForces") guiSetVisible(windowjob, false) GUIEditor_Button[1] = guiCreateButton(22,200,108,35,"Take job",false,windowjob) GUIEditor_Label[1] = guiCreateLabel(193,-103,5,5,"",false,windowjob) GUIEditor_Button[2] = guiCreateButton(179,200,110,36,"Cancel",false,windowjob) GUIEditor_Memo[1] = guiCreateMemo(19,33,273,100,"To be a solider, press Take job.\n\nIf you don't want to, press Cancel.",false,windowjob) guiEditSetReadOnly(GUIEditor_Memo[1],true) function Armed_Forces(hitElement) if getElementType(hitElement) == "player" and (hitElement == localPlayer) then if not guiGetVisible(windowjob) then guiSetVisible(windowjob, true) showCursor(true) end end end addEventHandler("onClientMarkerHit", marker, Armed_Forces) function Soliderjobleave(leaveElement) if getElementType(leaveElement) == "player" and (leaveElement == localPlayer) then if guiGetVisible(windowjob) then guiSetVisible(windowjob, false) showCursor(false) end end end addEventHandler("onClientMarkerLeave", marker, Soliderjobleave) function joinTeam() triggerServerEvent("setArmedForces",localPlayer) guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[1] , joinTeam, false) function removeArmedForcesWindow() guiSetVisible(windowjob, false) showCursor(false) end addEventHandler("onClientGUIClick", GUIEditor_Button[2] , removeArmedForcesWindow, false) server side: createBlip ( 95.459037780762, 1923.5686035156, 18.107088088989, 56 ) function createArmedForcesTeam () ArmedForcesteam = createTeam ("ArmedForces",69,139,0) end addEventHandler ("onResourceStart", resourceRoot, createArmedForcesTeam) function joinArmedForces() setPlayerTeam(source,ArmedForces,team) setElementModel(source, 287) giveWeapon ( source, 3, 24, 31) setElementData( source, "Occupation", "ArmedForcesteam", true ) outputChatBox("You are now a solider.",source,69,139,0) end addEvent("setArmedForces", true) addEventHandler("setArmedForces",root,joinArmedForces) function policeJob ( attacker, attackerweapon, bodypart, loss ) theTeam = getPlayerTeam ( attacker ) if (attackerweapon == 3) and (loss > 2 ) then setElementPosition (source, 219, 110, 999, true) setTimer ( setElementPosition, 100000, 1, source, 236.32, 110.4, 1003.2) takePlayerMoney (source, 50) givePlayerMoney (attacker, 100) end end addEventHandler ("onPlayerDamage", getRootElement(), armedforces) Link to comment
iPrestege Posted June 9, 2013 Share Posted June 9, 2013 You want to show the gui for a team only ? Link to comment
Chronos Posted June 9, 2013 Author Share Posted June 9, 2013 You want to show the gui for a team only ? this is my problem when i join team for example armedforces i want my name be in armedforces members. http://s3.postimg.org/is114nnz7/mta_scr ... _45_55.png http://s3.postimg.org/6imlrqt5v/mta_scr ... _46_00.png http://s3.postimg.org/o64epy337/mta_scr ... _46_04.png Link to comment
iPrestege Posted June 9, 2013 Share Posted June 9, 2013 Line -9- Server Side : Change the set team function to : setPlayerTeam(source,ArmedForces) And try . Link to comment
Chronos Posted June 9, 2013 Author Share Posted June 9, 2013 Line -9- Server Side :Change the set team function to : setPlayerTeam(source,ArmedForces) And try . nah still the same problem. Link to comment
bradio10 Posted June 9, 2013 Share Posted June 9, 2013 function joinArmedForces() setPlayerTeam(source,ArmedForces,team) setElementModel(source, 287) giveWeapon ( source, 3, 24, 31) setElementData( source, "Occupation", "ArmedForcesteam", true ) outputChatBox("You are now a solider.",source,69,139,0) end addEvent("setArmedForces", true) addEventHandler("setArmedForces",root,joinArmedForces) Where you have set the team, you put an extra comma. It needs to be setPlayerTeam(source,ArmedForcesteam) AKA remove the comma 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