rabe3 Posted August 19, 2013 Share Posted August 19, 2013 (edited) السلام عليكم الي يحفض التيم اذا ضفت واحد بفريق يضله حافظه واذا طردته من الفريق ينطرد بس لما يسوي اعاده تسجيل دخول saveteam عندي انا سيرفر فري روم وعندي سكربت يرجع بلفريق وهاذ الكود addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") -- gets players team if (team==getTeamName(getTeamFromName(team))) then setPlayerTeam(source, getTeamFromName(team)) -- sets players team end end) -- sets players team on login function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) if not isGuestAccount(account) then -- Checks to see if the player is a guest or not if(team)then setAccountData(account, "team", getTeamName(team)) --saves team end end end addEventHandler("onPlayerLogout", root, save) -- saves team on logout addEventHandler("onPlayerQuit", root, save) -- saves team on quit Edited August 19, 2013 by Guest Link to comment
فاّرس Posted August 19, 2013 Share Posted August 19, 2013 جرب كذا , -- Server Side # addEventHandler('onPlayerQuit',root, function() local acc = getPlayerAccount(source) if not acc or isGuestAccount(acc) then return end setAccountData(acc,'Team',getPlayerTeam(source)) end ) addEventHandler('onPlayerLogin',root, function(_,acc) local Data = getAccountData(acc,'Team') if ( Data ) then setPlayerTeam(source,getTeamFromName(Data)) end end ) ^ الكود لو خرج اللاعب يحفظ التيم حقه , ولو سجل الدخول يرجع للتيم حقه , + onPlayerLogout = اصلا لو سجل الخروج ما بينسحب التيم حقه, فـ ماله داعي ذذ واذا مو قصدك كذا اشرح لي اكثر Link to comment
rabe3 Posted August 19, 2013 Author Share Posted August 19, 2013 جرب كذا ,-- Server Side # addEventHandler('onPlayerQuit',root, function() local acc = getPlayerAccount(source) if not acc or isGuestAccount(acc) then return end setAccountData(acc,'Team',getPlayerTeam(source)) end ) addEventHandler('onPlayerLogin',root, function(_,acc) local Data = getAccountData(acc,'Team') if ( Data ) then setPlayerTeam(source,getTeamFromName(Data)) end end ) ^ الكود لو خرج اللاعب يحفظ التيم حقه , ولو سجل الدخول يرجع للتيم حقه , + onPlayerLogout = اصلا لو سجل الخروج ما بينسحب التيم حقه, فـ ماله داعي ذذ واذا مو قصدك كذا اشرح لي اكثر قصدي يعني لو انا طلعت الاعب من التيم يحفظ انه طلع من التيم Link to comment
فاّرس Posted August 19, 2013 Share Posted August 19, 2013 ووش تستفيد لو حفظت ؟ يعني هو طلع خلاص !,؟ Link to comment
AHMAD1234 Posted August 19, 2013 Share Posted August 19, 2013 ..هذا والله أعلم addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") -- gets players team if not team or team == false then return end setPlayerTeam(source, getTeamFromName(team)) -- sets players team end) -- sets players team on login function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) if not isGuestAccount(account) then -- Checks to see if the player is a guest or not if(team)then setAccountData(account, "team", getTeamName(team)) --saves team else setAccountData(account, "team", false) --saves team end end end addEventHandler("onPlayerLogout", root, save) -- saves team on logout addEventHandler("onPlayerQuit", root, save) -- saves team on quit Link to comment
rabe3 Posted August 19, 2013 Author Share Posted August 19, 2013 ..هذا والله أعلم addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") -- gets players team if not team or team == false then return end setPlayerTeam(source, getTeamFromName(team)) -- sets players team end) -- sets players team on login function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) if not isGuestAccount(account) then -- Checks to see if the player is a guest or not if(team)then setAccountData(account, "team", getTeamName(team)) --saves team else setAccountData(account, "team", false) --saves team end end end addEventHandler("onPlayerLogout", root, save) -- saves team on logout addEventHandler("onPlayerQuit", root, save) -- saves team on quit بارك الله فيكم والله ماتقصرون ابدا تم الحل Link to comment
AHMAD1234 Posted August 19, 2013 Share Posted August 19, 2013 ..هذا والله أعلم addEventHandler("onPlayerLogin",root,function() local team = getAccountData (getPlayerAccount(source), "team") -- gets players team if not team or team == false then return end setPlayerTeam(source, getTeamFromName(team)) -- sets players team end) -- sets players team on login function save() local team = getPlayerTeam(source) -- Gets the players team local account = getPlayerAccount(source) if not isGuestAccount(account) then -- Checks to see if the player is a guest or not if(team)then setAccountData(account, "team", getTeamName(team)) --saves team else setAccountData(account, "team", false) --saves team end end end addEventHandler("onPlayerLogout", root, save) -- saves team on logout addEventHandler("onPlayerQuit", root, save) -- saves team on quit بارك الله فيكم والله ماتقصرون ابدا تم الحل العفو, حياك الله في اي وقت يالطيب ض1 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