#STZ Posted December 17, 2016 Share Posted December 17, 2016 السلام عليكم و رحمة الله و بركاته ابي اسوي لما يكتب في ايديت اسم تيم و يضغط زر يسوي التيم و يضيف اللاعب فيه بس مدري الدي بق يقول ان المشكلة من التريقر --Client addEventHandler("onClientGUIClick",root, function() local MAKETEAM = guiGetText(GUIEditor.edit[1]) if source == GUIEditor.button[1] then triggerServerEvent ( 'MAKETEAM', getLocalPlayer (), MAKETEAM) end end ) --Server addEvent('MAKETEAM',true) addEventHandler('MAKETEAM',getRootElement(), function(Team) local newTeam = createTeam ( Team ) setPlayerTeam ( source, Team ) end end ) اتمني المساعدة و تصحيح الكود Link to comment
خلف Posted December 17, 2016 Share Posted December 17, 2016 في السيرفر انت مزود end امسح وحدها منه و خل القوس عدله setPlayerTeam ( source, Team ) خله setPlayerTeam ( source, newTeam ) Link to comment
#STZ Posted December 17, 2016 Author Share Posted December 17, 2016 ممكن هاذا كمان ابي لما احط اسم حساب و اضغط زر يضيف صاحب الحساب local addplayer = guiGetText(GUIEditor.button[2]) local teamplayer = getPlayerTeam ( addplayer ) addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer) end end ) local accountname = getAccountName addEvent('addplayer',true) addEventHandler('addplayer',getRootElement(), function(Team) setPlayerTeam ( source, accountname ) end ) ابي يضيفه في تيم الشخص اللي ضغط الزر Link to comment
خلف Posted December 17, 2016 Share Posted December 17, 2016 ما اتوقع تقدر لاكن تقدر تضيف الاعب بتيم من اسمه getPlayerFromName ( string playerName ) Link to comment
Master_MTA Posted December 17, 2016 Share Posted December 17, 2016 (edited) 2 hours ago, MR.NaiF-MTA said: ممكن هاذا كمان ابي لما احط اسم حساب و اضغط زر يضيف صاحب الحساب local addplayer = guiGetText(GUIEditor.button[2]) local teamplayer = getPlayerTeam ( addplayer ) addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer) end end ) local accountname = getAccountName addEvent('addplayer',true) addEventHandler('addplayer',getRootElement(), function(Team) setPlayerTeam ( source, accountname ) end ) ابي يضيفه في تيم الشخص اللي ضغط الزر دبل اللوكال بلاير بالكلنت هذا كله غلط اصلا local accountname = getAccountName addEvent('addplayer',true) addEventHandler('addplayer',getRootElement(), function(Team) setPlayerTeam ( source, accountname ) end ) Edited December 17, 2016 by Master_MTA Link to comment
iMr ~ MnHmAr Posted December 17, 2016 Share Posted December 17, 2016 (edited) -- #Clinet addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then local addplayer = guiGetText(NameEdit) -- اسم الايديت بوكس حقك triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer,teamplayer) end end ) -- #Server addEvent('addplayer',true) addEventHandler('addplayer',getRootElement(), function(addplayer,teamplayer) local account = getPlayerAccount ( addplayer ) if account then local accname = getAccountName ( account ) setPlayerTeam ( source , "اسم التيم " ) end end ) Edited December 17, 2016 by iMr ~ MnHmAr Link to comment
Abdul KariM Posted December 17, 2016 Share Posted December 17, 2016 عشان تضيف صاحب الحساب استخدم getAccount getAccountPlayer getAccountPlayer - راح ترجعلك بلاعب اذا اكان الحساب صحيح Link to comment
iMr ~ MnHmAr Posted December 17, 2016 Share Posted December 17, 2016 (edited) -- #Clinet addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then local addplayer = guiGetText(NameEdit) -- اسم الايديت بوكس حقك triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer,teamplayer) end end ) -- #Server addEvent('addplayer',true) addEventHandler('addplayer',getRootElement(), function(addplayer,teamplayer) local acc = getAccount(player1) if acc and not isGuestAccount(acc) then local account = getAccountName(acc) if account then setPlayerTeam ( source , "اسم التيم " ) end end end ) Edited December 17, 2016 by iMr ~ MnHmAr Link to comment
iMr ~ MnHmAr Posted December 17, 2016 Share Posted December 17, 2016 Just now, Abdul KariM said: ^ غلط ليه وش الغلط -- #Clinet addEventHandler("onClientGUIClick",root, function() if source == GUIEditor.button[1] then local addplayer = guiGetText(NameEdit) -- اسم الايديت بوكس حقك triggerServerEvent ( 'addplayer', getLocalPlayer (), addplayer) end end ) -- #Server addEvent('addplayer',true) addEventHandler('addplayer',getRootElement(), function(addplayer) local acc = getAccount(addplayer) if acc and not isGuestAccount(acc) then local account = getAccountName(acc) if account then setPlayerTeam ( source , "اسم التيم " ) end end end ) Link to comment
Abdul KariM Posted December 17, 2016 Share Posted December 17, 2016 راجع ردي الي فوق وراح تعرف ليه غلط Link to comment
Jw8. Posted December 24, 2016 Share Posted December 24, 2016 function teamName ( source, key, newTeamName ) local playerTeam = getPlayerTeam ( source ) -- get the player's team if ( playerTeam ) then -- if he's on a team local oldTeamName = getTeamName ( playerTeam ) -- get the team's current name setTeamName ( playerTeam, newTeamName ) -- change its name outputChatBox ( "Changed " .. getPlayerName ( source ).."Is team name from " .. oldTeamName .. " to " .. newTeamName ) else outputChatBox ( getPlayerName ( source ) .. " isn't on a team" ) end end addCommandHandler ( "Team", teamName ) 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