D7mas Posted August 28, 2017 Share Posted August 28, 2017 السلام عليكم ورحمة الله وبركاتة اخباركم يا شباب ان شاء الله بصحة والسلامه ما بطول عليكو انا كما لاحظتو في العنوان مشلكتي بشات القروب لما اكتب ما يظهر ويقولي المشكلة في ERROR: Group_System\server.lua:653: bad argument #2 to 'format' (number expected, got ail) الكود حق السطر 653 local color = string.format("#%02X%02X%02X", r, g, b) local chatColorTable = getGroupChatColor(group) local chatColor = string.format("#%02X%02X%02X", chatColorTable[1], chatColorTable[2], chatColorTable[3]) -- ذا هو السطر 653 for _,v in ipairs(getElementsByType("player")) do local account = getAccountName ( getPlayerAccount ( v ) ) if ( isObjectInACLGroup ( "user." .. account, aclGetGroup ( "Staff" ) ) ) and getElementData(v,"SeeGroupChat") and getElementData(v ,"Group") ~= group then outputChatBox("#FFFFFF("..group..")#FF00FF["..nisck.."]"..color..""..nick.." : #FFFF00"..msg, v, 255, 255, 255, true) -- outputDebugString("(Group) ("..group..") "..nick..": "..msg) -- outputServerLog("(Group) ("..group..") "..nick..": "..msg) end end for i, v in ipairs(getGroupOnlineMember(group)) do if doesPlayerHavePermission(player, 17) then playSoundFrontEnd(player, 101) outputChatBox( "(Group) : #CCCCCC["..nisck.."#CCCCCC] "..color..""..nick.." : #33CCCC"..msg,v, 0, 255, 255, true) else outputChatBox( "(Group) : #FF0000["..nisck.."#FF0000] "..color..""..nick.." : "..chatColor..""..msg,v, 0, 255, 255, true) end end end end end end المشكلة في السطر ال3 هنا Link to comment
+Source|> Posted August 28, 2017 Share Posted August 28, 2017 1 hour ago, D7mas said: السلام عليكم ورحمة الله وبركاتة اخباركم يا شباب ان شاء الله بصحة والسلامه ما بطول عليكو انا كما لاحظتو في العنوان مشلكتي بشات القروب لما اكتب ما يظهر ويقولي المشكلة في ERROR: Group_System\server.lua:653: bad argument #2 to 'format' (number expected, got ail) الكود حق السطر 653 local color = string.format("#%02X%02X%02X", r, g, b) local chatColorTable = getGroupChatColor(group) local chatColor = string.format("#%02X%02X%02X", chatColorTable[1], chatColorTable[2], chatColorTable[3]) -- ذا هو السطر 653 for _,v in ipairs(getElementsByType("player")) do local account = getAccountName ( getPlayerAccount ( v ) ) if ( isObjectInACLGroup ( "user." .. account, aclGetGroup ( "Staff" ) ) ) and getElementData(v,"SeeGroupChat") and getElementData(v ,"Group") ~= group then outputChatBox("#FFFFFF("..group..")#FF00FF["..nisck.."]"..color..""..nick.." : #FFFF00"..msg, v, 255, 255, 255, true) -- outputDebugString("(Group) ("..group..") "..nick..": "..msg) -- outputServerLog("(Group) ("..group..") "..nick..": "..msg) end end for i, v in ipairs(getGroupOnlineMember(group)) do if doesPlayerHavePermission(player, 17) then playSoundFrontEnd(player, 101) outputChatBox( "(Group) : #CCCCCC["..nisck.."#CCCCCC] "..color..""..nick.." : #33CCCC"..msg,v, 0, 255, 255, true) else outputChatBox( "(Group) : #FF0000["..nisck.."#FF0000] "..color..""..nick.." : "..chatColor..""..msg,v, 0, 255, 255, true) end end end end end end المشكلة في السطر ال3 هنا اسمع دور على الأربع سطور ذي bindKey("i","down","chatbox","gc") -- تقريبا سطر 1162 unbindKey("i","down","chatbox","gc") -- تقريبا سطر 1180 bindKey("i","down","chatbox","gc") -- تقريبا سطر 1332 unbindKey("i","down","chatbox","gc") -- تقريبا سطر 1350 gc تشوف كلمة في الاربع سطور بدلها بكلمة GroupChat Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 4 minutes ago, A7MEDENO said: اسمع دور على الأربع سطور ذي bindKey("i","down","chatbox","gc") -- تقريبا سطر 1162 unbindKey("i","down","chatbox","gc") -- تقريبا سطر 1180 bindKey("i","down","chatbox","gc") -- تقريبا سطر 1332 unbindKey("i","down","chatbox","gc") -- تقريبا سطر 1350 gc تشوف كلمة في الاربع سطور بدلها بكلمة GroupChat ذا مود أخر function setButtonStat() if getElementData(localPlayer, "Group") then guiSetText(Name_Group_Label,"Group Name: "..getElementData(localPlayer, "Group")) guiSetEnabled(Leave_Group_Button, true) guiSetEnabled(Members_Group_Button, true) guiSetEnabled(InfoEdit_Group_Button, true) guiSetEnabled(Group_Rank_Button, true) guiSetEnabled(Group_Bank_Button, true) guiSetEnabled(Group_Alliance_Button, true) guiSetEnabled(Black_List_Button, true) guiSetEnabled(baseSpawnChk, true) guiSetEnabled(BlipGroup, true) bindKey("i","down","chatbox","GroupChat") guiSetVisible(Create_Group_Label, false) guiSetVisible(Create_Group_Button, false) guiSetVisible(Create_Group_Edit, false) guiSetVisible(NextRanke_Group_Label, true) guiSetVisible(Ranke_Group_Label, true) guiSetVisible(Online_Group_Label, true) else guiSetText(Name_Group_Label,"Group Name: false") guiSetEnabled(Create_Group_Button, true) guiSetEnabled(Leave_Group_Button, false) guiSetEnabled(Members_Group_Button, false) guiSetEnabled(InfoEdit_Group_Button, false) guiSetEnabled(Group_Rank_Button, false) guiSetEnabled(Group_Bank_Button, false) guiSetEnabled(Group_Alliance_Button, false) guiSetEnabled(Black_List_Button, false) guiSetEnabled(baseSpawnChk, false) guiSetEnabled(BlipGroup, false) guiSetVisible(NextRanke_Group_Label, false) guiSetVisible(Ranke_Group_Label, false) guiSetVisible(Online_Group_Label, false) guiSetVisible(Create_Group_Label, true) guiSetVisible(Create_Group_Button, true) guiSetVisible(Create_Group_Edit, true) unbindKey("i","down","chatbox","GroupChat") unbindKey("o","down","chatbox","GroupAllianceschat") end addEventHandler("onClientElementDataChange", root, function(dataName,oldData) if getElementType(source) == "player" and source == localPlayer then if dataName == "Group" then if getElementData(localPlayer, "Group") then guiSetText(Name_Group_Label,"Group Name: "..getElementData(localPlayer, "Group")) guiSetEnabled(Create_Group_Button, false) guiSetEnabled(Leave_Group_Button, true) guiSetEnabled(Members_Group_Button, true) guiSetEnabled(InfoEdit_Group_Button, true) guiSetEnabled(Group_Rank_Button, true) guiSetEnabled(Group_Bank_Button, true) guiSetEnabled(Group_Alliance_Button, true) guiSetEnabled(Black_List_Button, true) guiSetEnabled(baseSpawnChk, true) guiSetEnabled(BlipGroup, true) bindKey("i","down","chatbox","GroupChat") guiSetVisible(Create_Group_Label, false) guiSetVisible(Create_Group_Button, false) guiSetVisible(Create_Group_Edit, false) guiSetVisible(NextRanke_Group_Label, true) guiSetVisible(Ranke_Group_Label, true) guiSetVisible(Online_Group_Label, true) else guiSetText(Name_Group_Label,"Group Name: false") guiSetEnabled(Create_Group_Button, true) guiSetEnabled(Leave_Group_Button, false) guiSetEnabled(Members_Group_Button, false) guiSetEnabled(InfoEdit_Group_Button, false) guiSetEnabled(Group_Rank_Button, false) guiSetEnabled(Group_Bank_Button, false) guiSetEnabled(Group_Alliance_Button, false) guiSetEnabled(Black_List_Button, false) guiSetEnabled(baseSpawnChk, false) guiSetEnabled(BlipGroup, false) unbindKey("i","down","chatbox","GroupChat") unbindKey("o","down","chatbox","GroupAllianceschat") guiSetVisible(NextRanke_Group_Label, false) guiSetVisible(Ranke_Group_Label, false) guiSetVisible(Online_Group_Label, false) guiSetVisible(Create_Group_Label, true) guiSetVisible(Create_Group_Button, true) guiSetVisible(Create_Group_Edit, true) end Link to comment
SycroX Posted August 28, 2017 Share Posted August 28, 2017 2 hours ago, A7MEDENO said: اسمع دور على الأربع سطور ذي bindKey("i","down","chatbox","gc") -- تقريبا سطر 1162 unbindKey("i","down","chatbox","gc") -- تقريبا سطر 1180 bindKey("i","down","chatbox","gc") -- تقريبا سطر 1332 unbindKey("i","down","chatbox","gc") -- تقريبا سطر 1350 gc تشوف كلمة في الاربع سطور بدلها بكلمة GroupChat وش دخل ذا بالموضوع ؟ المهم صاحب الموضوع تاكد من فانكشن getGroupChatColor Link to comment
coNolel Posted August 28, 2017 Share Posted August 28, 2017 تأكد من القيمة اللي ترجعها getGroupChatColor أو انو ما عرفت تجيب الـ group Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 11 minutes ago, coNolel said: تأكد من القيمة اللي ترجعها getGroupChatColor أو انو ما عرفت تجيب الـ group 19 minutes ago, #x1AhMeD,-09 said: وش دخل ذا بالموضوع ؟ المهم صاحب الموضوع تاكد من فانكشن getGroupChatColor function getGroupChatColor(group) if group and IsGroupExists(group) then local h = dbQuery(db, "SELECT Chat_color FROM groups WHERE group_name = ?", group) local result = dbPoll(h, -1) return split(result[1]["Chat_color"], ',') end Link to comment
MR.StoRm Posted August 28, 2017 Share Posted August 28, 2017 1 minute ago, D7mas said: function getGroupChatColor(group) if group and IsGroupExists(group) then local h = dbQuery(db, "SELECT Chat_color FROM groups WHERE group_name = ?", group) local result = dbPoll(h, -1) return split(result[1]["Chat_color"], ',') end ناقص إيند ذذ 1 Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 3 hours ago, MR.StoRm said: ناقص إيند ذذ موجوده بس ما نسختها الووووووو مستاعدة يا شباب ضروري يلا في مشكلة يعني من شي غير ذول Link to comment
iyaad Posted August 28, 2017 Share Posted August 28, 2017 اخي جرب غير لون الشات من اللوحة لانو اكواد صحيحة 100% وما فها اي خطأ + اذا ما زبط قللي بس الواضح انو ما في لون لشات هنا , يعني ما رح شكتب في الشات ابداً 1 Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 زبطت اخي طريقتك مشكوررر , انا اراقب الموضوع من الصبح ضض شكلو تخصصك موودات قروبات ضض بس مساعدة اخرا انا بدي اللون اول ما ينعمل القروب يكون اصفر مثلاً مشان اول ما حد يعمل ثروب على السريع يكتب مو يصير يقولو في مشكلة ومدري وش Link to comment
#BrosS Posted August 28, 2017 Share Posted August 28, 2017 Just now, D7mas said: زبطت اخي طريقتك مشكوررر , انا اراقب الموضوع من الصبح ضض شكلو تخصصك موودات قروبات ضض بس مساعدة اخرا انا بدي اللون اول ما ينعمل القروب يكون اصفر مثلاً مشان اول ما حد يعمل ثروب على السريع يكتب مو يصير يقولو في مشكلة ومدري وش اطرح اكواد عمل الثروب 1 Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 function CreateGroup(player, name) if not IsGroupExists(name) then local data = data() local playerName = getPlayerName(player) local accountName = getAccountName(getPlayerAccount(player)) local color = math.random(255)..", "..math.random(255)..", "..math.random(255) dbExec(db, "INSERT INTO groups VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", name, accountName, 1, 20, "The group leader has not made a message Yet", playerName.." ("..accountName..") created the group "..name, 0, color, 0, 45) for i, R in ipairs(Ranks_Table) do if R[1] == "Founder" then dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 1) elseif R[1] == "Trial" then dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 2) else dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 3) end end dbExec(db, "INSERT INTO group_members VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", name, accountName, playerName, "Yes", "Founder", data, 0, "false","false") setElementData(player, "Group", name) setElementData(player, "GroupRank", {getGroupRanks(name), getPlayerGroupRank(player)}) setElementData(player, "GroupAlliances", getGroupAlliances(name)) exports["guimessages"]:outputServer (player, "#33FFFF[Group System] #CC3333"..name.." #FF0000has been created successfully.", 0, 255, 0) setNewGrouplog ( name, playerName.." Gas Been Created "..name ) else exports["guimessages"]:outputServer (player, "#33FFFF[Group System] #CC3333The Group name #DF7401"..name.." #FF0000is already exists.", 255, 0, 0) end end 1 minute ago, #BrosS said: اطرح اكواد عمل الثروب قرروب ولكن مجرد خطأ املائي بسبب السرعة Link to comment
#BrosS Posted August 28, 2017 Share Posted August 28, 2017 Just now, D7mas said: function CreateGroup(player, name) if not IsGroupExists(name) then local data = data() local playerName = getPlayerName(player) local accountName = getAccountName(getPlayerAccount(player)) local color = math.random(255)..", "..math.random(255)..", "..math.random(255) dbExec(db, "INSERT INTO groups VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", name, accountName, 1, 20, "The group leader has not made a message Yet", playerName.." ("..accountName..") created the group "..name, 0, color, 0, 45) for i, R in ipairs(Ranks_Table) do if R[1] == "Founder" then dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 1) elseif R[1] == "Trial" then dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 2) else dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 3) end end dbExec(db, "INSERT INTO group_members VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", name, accountName, playerName, "Yes", "Founder", data, 0, "false","false") setElementData(player, "Group", name) setElementData(player, "GroupRank", {getGroupRanks(name), getPlayerGroupRank(player)}) setElementData(player, "GroupAlliances", getGroupAlliances(name)) exports["guimessages"]:outputServer (player, "#33FFFF[Group System] #CC3333"..name.." #FF0000has been created successfully.", 0, 255, 0) setNewGrouplog ( name, playerName.." Gas Been Created "..name ) else exports["guimessages"]:outputServer (player, "#33FFFF[Group System] #CC3333The Group name #DF7401"..name.." #FF0000is already exists.", 255, 0, 0) end end قرروب ولكن مجرد خطأ املائي بسبب السرعة وين اللي يلون القروب صحيح وش ذا لون القروب كلام الشات ولا شنو ؟؟ 1 Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 11 minutes ago, #BrosS said: وين اللي يلون القروب صحيح وش ذا لون القروب كلام الشات ولا شنو ؟؟ لون كلام في الشات Link to comment
#BrosS Posted August 28, 2017 Share Posted August 28, 2017 Just now, #BrosS said: local color = math.random(255)..", "..math.random(255)..", "..math.random(255) اتوقع ذا هو اللون ¯\_(ツ)_/¯ 1 Link to comment
D7mas Posted August 28, 2017 Author Share Posted August 28, 2017 1 hour ago, #BrosS said: اتوقع ذا هو اللون ¯\_(ツ)_/¯ ما زبط , بطل يعمل قروب Link to comment
#BrosS Posted August 28, 2017 Share Posted August 28, 2017 2 hours ago, D7mas said: ما زبط , بطل يعمل قروب انا طلبت منك فعل شي عشان تقولي مازبط ؟ ? وش سويت يمكن حذفت فاصلة ಥ⌣ಥ Link to comment
SycroX Posted August 29, 2017 Share Posted August 29, 2017 اطرح كود انشاء التابل حق الجروبات - groups عشان نشوف ترتيب الكولمن Link to comment
D7mas Posted August 29, 2017 Author Share Posted August 29, 2017 17 hours ago, #BrosS said: 8 hours ago, #x1AhMeD,-09 said: اطرح كود انشاء التابل حق الجروبات - groups مو ملاقي للإسف Link to comment
SycroX Posted August 29, 2017 Share Posted August 29, 2017 تلاقيه عند حدث onResourceStart CREATE TABLE IF NOT EXISTS groups ( .... ) Link to comment
D7mas Posted August 30, 2017 Author Share Posted August 30, 2017 14 hours ago, #Soking said: هاي وش المشكله مشكلتي انو اول ما اسوي القروب ما يقدرو يكتبو بشات غير لما يغيرو لون القروب انا بدي اول ما يسوي القروب يكون اللون اصفر مثلاً 14 hours ago, #x1AhMeD,-09 said: تلاقيه عند حدث addEventHandler("onResourceStart", resourceRoot, function() local data = data() exports.scoreboard:addScoreboardColumn("Group", root, 3, 80) db = dbConnect("sqlite", "database.db") dbExec(db, "CREATE TABLE IF NOT EXISTS groups (group_name, group_owner, group_members INT, members_limit, group_info, group_history, group_bank INT, turf_color, total_turf, skinID, MessageLeaved, Chat_color)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_ranks (group_name, group_rank_name, group_rank_permission, rank_type)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_members (group_name, member_account, member_name, member_status, member_rank, last_online, WL, mute, AFK)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_invite (group_name, player_account, byy)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_alliances (group_name1, group_name2, status)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_blackList (group_name, player_account, responsible, reason, time)") dbExec(db, "CREATE TABLE IF NOT EXISTS group_history (group_name, action, data)") dbExec(db, "CREATE TABLE IF NOT EXISTS MessageLeaved (group_name, Time, Name, Account, Message)") for i, player in ipairs(getElementsByType("player")) do local groupName = getPlayerGroup(player) if groupName then setElementData(player, "Group", groupName) setElementData(player, "GroupAlliances", getGroupAlliances(groupName)) setElementData(player, "GroupRank", {getGroupRanks(groupName), getPlayerGroupRank(player)}) dbExec(db, "UPDATE group_members SET member_name = ?, member_status = ?, last_online = ? WHERE group_name = ? AND member_account = ?", getPlayerName(player),"Yes",data,groupName,getAccountName(getPlayerAccount(player))) else setElementData(player, "Group", false) setElementData(player, "GroupAlliances", false) setElementData(player, "GroupRank", false) end end end) Link to comment
SycroX Posted August 30, 2017 Share Posted August 30, 2017 (edited) function CreateGroup(player, name) if not IsGroupExists(name) then local data = data() local playerName = getPlayerName(player) local accountName = getAccountName(getPlayerAccount(player)) local color = math.random(255)..", "..math.random(255)..", "..math.random(255) dbExec(db, "INSERT INTO groups VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", name, accountName, 1, 20, "The group leader has not made a message Yet", playerName.." ("..accountName..") created the group "..name, 0, color, 0, 45, "", "255, 255, 0") for i, R in ipairs(Ranks_Table) do if R[1] == "Founder" then dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 1) elseif R[1] == "Trial" then dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 2) else dbExec(db, "INSERT INTO group_ranks VALUES(?, ?, ?, ?)", name, R[1], R[2], 3) end end dbExec(db, "INSERT INTO group_members VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)", name, accountName, playerName, "Yes", "Founder", data, 0, "false","false") setElementData(player, "Group", name) setElementData(player, "GroupRank", {getGroupRanks(name), getPlayerGroupRank(player)}) setElementData(player, "GroupAlliances", getGroupAlliances(name)) exports["guimessages"]:outputServer (player, "#33FFFF[Group System] #CC3333"..name.." #FF0000has been created successfully.", 0, 255, 0) setNewGrouplog ( name, playerName.." Gas Been Created "..name ) else exports["guimessages"]:outputServer (player, "#33FFFF[Group System] #CC3333The Group name #DF7401"..name.." #FF0000is already exists.", 255, 0, 0) end end Edited August 30, 2017 by #x1AhMeD,-09 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