w7sH Posted November 19, 2016 Share Posted November 19, 2016 السلام عليكم عندي كود شات تيم شبكته مع مود التاجات حقي وضبط تمام لكن فيه مشكله وحيده اذا مثلا تكلمت في تيم معين من خلال الشات الكل يشوف حتى اللي م عنده تيم يشوف الكلام ابيه انا بس اعضاء التيم اللي يشوفون كلامي وهذا الكود حقي ------------- Teams chat addEventHandler("onResourceStart",getResourceRootElement(getThisResource()), function () for index, player in pairs(getElementsByType("player")) do bindKey(player,"y","down","chatbox","Teamsay") end end) addCommandHandler("Teamsay",function (plr,cmd,msg) local playerTeam = getPlayerTeam(plr) if (playerTeam) then local r, g, b = getTeamColor (playerTeam) outputChatBox('(TEAM)#FFFFFF '..colorHex(r, g, b)..''..getPlayerName(plr):gsub("#%x%x%x%x%x%x", "") ..': #FFFFFF'.. msg,root, r, g, b, true) end end) Link to comment
' A F . Posted November 19, 2016 Share Posted November 19, 2016 طيب اكيد ان راح يروح للكل لانك انت حاط root المفروض تسوي لوب وتستخدم هاذا الفنكشن getPlayersInTeam سويه واذا م ظبط معك اطرحه هنا ونحاول نصلحه لك ان شاء الله .. بالتوفيق Link to comment
N3xT Posted November 19, 2016 Share Posted November 19, 2016 addEventHandler("onResourceStart", resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "y","down", "chatbox", "Teamsay" ) end end ) addCommandHandler("Teamsay", function ( plr , cmd , msg) local playerTeam = getPlayerTeam ( plr ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) local players = getPlayersInTeam ( playerTeam ) for _,v in ipairs ( players ) do outputChatBox('(TEAM)#FFFFFF '..colorHex(r, g, b)..''..getPlayerName(plr):gsub("#%x%x%x%x%x%x", "") ..': #FFFFFF'.. msg,v, r, g, b, true) end end end Link to comment
!#NssoR_) Posted November 19, 2016 Share Posted November 19, 2016 5 hours ago, N3xT said: addEventHandler("onResourceStart", resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "y","down", "chatbox", "Teamsay" ) end end ) addCommandHandler("Teamsay", function ( plr , cmd , msg) local playerTeam = getPlayerTeam ( plr ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) local players = getPlayersInTeam ( playerTeam ) for _,v in ipairs ( players ) do outputChatBox('(TEAM)#FFFFFF '..colorHex(r, g, b)..''..getPlayerName(plr):gsub("#%x%x%x%x%x%x", "") ..': #FFFFFF'.. msg,v, r, g, b, true) end end end طريقتك في إظهار رسالة اللاعب بالشات خطأ في حال سويت مسافه بين الكلام راح يظهر اول جزء من الرسالة اما الباقي بيختفي الكود يكون بهذا الشكل addEventHandler("onResourceStart", resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "y","down", "chatbox", "Teamsay" ) end end ) addEventHandler("onPlayerJoin", root, function () bindKey ( source, "y","down", "chatbox", "Teamsay" ) end ) addCommandHandler("Teamsay", function ( plr , cmd , ...) local playerTeam = getPlayerTeam ( plr ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) for _,v in ipairs ( getPlayersInTeam ( playerTeam ) ) do outputChatBox('(TEAM)#FFFFFF '..colorHex(r, g, b)..''..getPlayerName(plr):gsub("#%x%x%x%x%x%x", "") ..': #FFFFFF'..table.concat({...},' '),v, r, g, b, true) end end end) Link to comment
N3xT Posted November 19, 2016 Share Posted November 19, 2016 ^ ما ركزت بإظهاره بالشات, لأنه ما عطاني كل المشاكل اللي تواجهه قال أنه يجي بس للكل, عموماً شكراً للتنبيه Link to comment
w7sH Posted November 21, 2016 Author Share Posted November 21, 2016 كذا طفى مود التاجات Link to comment
w7sH Posted August 13, 2018 Author Share Posted August 13, 2018 On ١٩/١١/٢٠١٦ at 09:29, !#NssoR_) said: طريقتك في إظهار رسالة اللاعب بالشات خطأ في حال سويت مسافه بين الكلام راح يظهر اول جزء من الرسالة اما الباقي بيختفي الكود يكون بهذا الشكل addEventHandler("onResourceStart", resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "y","down", "chatbox", "Teamsay" ) end end ) addEventHandler("onPlayerJoin", root, function () bindKey ( source, "y","down", "chatbox", "Teamsay" ) end ) addCommandHandler("Teamsay", function ( plr , cmd , ...) local playerTeam = getPlayerTeam ( plr ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) for _,v in ipairs ( getPlayersInTeam ( playerTeam ) ) do outputChatBox('(TEAM)#FFFFFF '..colorHex(r, g, b)..''..getPlayerName(plr):gsub("#%x%x%x%x%x%x", "") ..': #FFFFFF'..table.concat({...},' '),v, r, g, b, true) end end end) طيب أبي اللاعب ااذا عنده ميوت مايقدر يتكلم كيف اضيفها؟ Link to comment
Rockyz Posted August 13, 2018 Share Posted August 13, 2018 addEventHandler("onResourceStart", resourceRoot, function () for index, player in pairs(getElementsByType("player")) do bindKey ( player, "y","down", "chatbox", "Teamsay" ) end end ) addEventHandler("onPlayerJoin", root, function () bindKey ( source, "y","down", "chatbox", "Teamsay" ) end ) addCommandHandler("Teamsay", function ( plr , cmd , ...) if not isPlayerMuted(plr) then local playerTeam = getPlayerTeam ( plr ) if ( playerTeam ) then local r, g, b = getTeamColor ( playerTeam ) for _,v in ipairs ( getPlayersInTeam ( playerTeam ) ) do outputChatBox('(TEAM)#FFFFFF '..colorHex(r, g, b)..''..getPlayerName(plr):gsub("#%x%x%x%x%x%x", "") ..': #FFFFFF'..table.concat({...},' '),v, r, g, b, true) end end else outputChatBox('Teamsay: You are muted!', plr, 50, 0, 100, true) end end) Link to comment
w7sH Posted August 13, 2018 Author Share Posted August 13, 2018 يعطيك العافية أخ روكيز , عندي سؤال أخر أقدر أخلي الكلام يطلع فالشات بيبول ... اللي يجي فوق راس اللاعب؟ Link to comment
Mr.Mostafa Posted August 13, 2018 Share Posted August 13, 2018 16 minutes ago, w7sH said: يعطيك العافية أخ روكيز , عندي سؤال أخر أقدر أخلي الكلام يطلع فالشات بيبول ... اللي يجي فوق راس اللاعب؟ شوف آلمود حقك , لو مآفي آكسبورت , سوي لوظيفة آظهآر آلكلآم فوق آلآعب آكسبورت , وسويهآ كدآ exports["آسم آلمود"] Link to comment
w7sH Posted August 13, 2018 Author Share Posted August 13, 2018 طيب جربت أحط هالكود ولا ضبط.. triggerClientEvent(v,"onChatbubblesMessageIncome",source,msg,2) 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