Mr.Mostafa Posted June 22, 2018 Share Posted June 22, 2018 سلام عليكم ابي مبرمج يسويلي بس لو رسترت العاجل - العاجل القديم الي كنت مسويه يضل زي ما هو ما يروح لان لسا اتدرب علي executeSQLQuery وما اعرف لها زين - وشكرا كلنت local sX, sY = guiGetScreenSize () addEventHandler("onClientRender", root, function () if ( getElementData ( resourceRoot, "Have_" ) == true ) then local Lines = getChatboxLayout ()["chat_lines"] if ( Lines <= 10 ) then Lines = Lines + 1 elseif ( Lines >= 20 ) then Lines = Lines - 1 else Lines = Lines end if ( getElementData ( resourceRoot, "Msg_" ) == "ايقاف العاجل" ) then setElementData ( resourceRoot, "Have_", false ) else dxDrawText("Admin : ✱╚▶ ║ " .. getElementData ( resourceRoot, "Msg_" ).. " ║◄╝✱", 14 - 1, 194 - 1, 953 - 1, 212 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Admin : ✱╚▶ ║ " .. getElementData ( resourceRoot, "Msg_" ).. " ║◄╝✱", 14 + 1, 194 - 1, 953 + 1, 212 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Admin : ✱╚▶ ║ " .. getElementData ( resourceRoot, "Msg_" ).. " ║◄╝✱", 14 - 1, 194 + 1, 953 - 1, 212 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Admin : ✱╚▶ ║ " .. getElementData ( resourceRoot, "Msg_" ).. " ║◄╝✱", 14 + 1, 194 + 1, 953 + 1, 212 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("Admin : ✱╚▶ ║ " .. getElementData ( resourceRoot, "Msg_" ).. " ║◄╝✱", 14, 194, 953, 212, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("".. getElementData ( resourceRoot, "By_" ) .."", 16 - 1, 213 - 1, 211 - 1, 232 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("".. getElementData ( resourceRoot, "By_" ) .."", 16 + 1, 213 - 1, 211 + 1, 232 - 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("".. getElementData ( resourceRoot, "By_" ) .."", 16 - 1, 213 + 1, 211 - 1, 232 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("".. getElementData ( resourceRoot, "By_" ) .."", 16 + 1, 213 + 1, 211 + 1, 232 + 1, tocolor(0, 0, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) dxDrawText("".. getElementData ( resourceRoot, "By_" ) .."", 16, 213, 211, 232, tocolor(145, 143, 143, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false) end end end) bindKey("u", "down", "chatbox","AdminMsg") " .. getElementData ( resourceRoot, "Msg_" ).. " سيرفر local Groups = { "Console", "AdminMsg" } function isPlayerAdmin(player) for k,v in ipairs ( Groups ) do if ( isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(player)), aclGetGroup(v)) ) then return true end end end addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", message ) if ( getElementData ( player, "Name" ) and getElementData ( player, "Name" ) ~= false ) then setElementData ( resourceRoot, "By_", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) end end) @+Source|> 1 Link to comment
^iiEcoo'x_) Posted June 22, 2018 Share Posted June 22, 2018 محاولتك طيب ؟ ع اساس تدرب ؟ فرجينا الي اتدربت عليه . Link to comment
Mr.Mostafa Posted June 22, 2018 Author Share Posted June 22, 2018 1 minute ago, #_iMr,[E]coo said: محاولتك طيب ؟ ع اساس تدرب ؟ فرجينا الي اتدربت عليه . لسا مب عارف اي شي عن هذا الكود / القاعدة 3 minutes ago, #_iMr,[E]coo said: محاولتك طيب ؟ ع اساس تدرب ؟ فرجينا الي اتدربت عليه . طيب شوف بحاول - المحاولة شي حلو! Link to comment
^iiEcoo'x_) Posted June 22, 2018 Share Posted June 22, 2018 1 minute ago, Mr.Mostafa said: لسا مب عارف اي شي عن هذا الكود / القاعدة في شرح بقسم دروس بالبرمجة , شوف و اتعلم واطرح محاولتك . Link to comment
Mr.Mostafa Posted June 22, 2018 Author Share Posted June 22, 2018 9 minutes ago, #_iMr,[E]coo said: في شرح بقسم دروس بالبرمجة , شوف و اتعلم واطرح محاولتك . حاولت لكن كل الكود يعتبر مافي نقطة صح حاول تقولي كيف اصلحه executeSQLQuery("CREATE TABLE IF NOT EXISTS saveAm (3agel TEXT, name TEXT)") addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", message ) executeSQLQuery("INSERT INTO saveAm(3agel,name) VALUES(?,?,?)", playerName ) if ( getElementData ( player, "Name" ) and getElementData ( player, "Name" ) ~= false ) then setElementData ( resourceRoot, "By_", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) end end) addEventHandler("onResourceStart", root, function () executeSQLQuery("SELECT 3agel FROM saveAm WHERE name=?", playerName ) end ) Link to comment
N3xT Posted June 23, 2018 Share Posted June 23, 2018 قاعد اجرب حركة, ومدري اذا بتظبط ولا لا لكن جرب الكود ورد علي executeSQLQuery("CREATE TABLE IF NOT EXISTS 3ajel ( myText TEXT, playerName TEXT )") addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", message ) if ( getElementData ( player, "Name" ) and getElementData ( player, "Name" ) ~= false ) then setElementData ( resourceRoot, "By_", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) end end) function myEvents () if ( eventName == "onResourceStop" ) then if ( getElementData ( resourceRoot, "Msg_" ) ~= "" and getElementData ( resourceRoot, "By_" ) ~= "" ) then local result = executeSQLQuery ( 'SELECT * FROM 3ajel' ) if ( #result == 0 ) then executeSQLQuery("INSERT INTO 3ajel ( myText, playerName ) VALUES( ?, ? )", getElementData ( resourceRoot, "Msg_" ) , getElementData ( resourceRoot, "By_" ) ) else executeSQLQuery("UPDATE 3ajel SET myText=?, playerName=?", getElementData ( resourceRoot, "Msg_" ), getElementData ( resourceRoot, "By_" ) ) end end elseif ( eventName == "onResourceStart" ) then local result = executeSQLQuery ( 'SELECT * FROM 3ajel' ) if ( #result ~= 0 ) then setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", result[1].myText ) setElementData ( resourceRoot, "By_", result[1].playerName ) end end end addEventHandler("onResourceStop", root, myEvents) addEventHandler("onResourceStart", root, myEvents) Link to comment
Mr.Mostafa Posted June 23, 2018 Author Share Posted June 23, 2018 1 hour ago, N3xT said: قاعد اجرب حركة, ومدري اذا بتظبط ولا لا لكن جرب الكود ورد علي executeSQLQuery("CREATE TABLE IF NOT EXISTS 3ajel ( myText TEXT, playerName TEXT )")addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", message ) if ( getElementData ( player, "Name" ) and getElementData ( player, "Name" ) ~= false ) then setElementData ( resourceRoot, "By_", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) endend)function myEvents () if ( eventName == "onResourceStop" ) then if ( getElementData ( resourceRoot, "Msg_" ) ~= "" and getElementData ( resourceRoot, "By_" ) ~= "" ) then local result = executeSQLQuery ( 'SELECT * FROM 3ajel' ) if ( #result == 0 ) then executeSQLQuery("INSERT INTO 3ajel ( myText, playerName ) VALUES( ?, ? )", getElementData ( resourceRoot, "Msg_" ) , getElementData ( resourceRoot, "By_" ) ) else executeSQLQuery("UPDATE 3ajel SET myText=?, playerName=?", getElementData ( resourceRoot, "Msg_" ), getElementData ( resourceRoot, "By_" ) ) end end elseif ( eventName == "onResourceStart" ) then local result = executeSQLQuery ( 'SELECT * FROM 3ajel' ) if ( #result ~= 0 ) then setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", result[1].myText ) setElementData ( resourceRoot, "By_", result[1].playerName ) end endendaddEventHandler("onResourceStop", root, myEvents) addEventHandler("onResourceStart", root, myEvents) Database query failed : unrecognized token : "3ajel" غيرت اسم القاعدة واصلا صار المود مب شغال نهائي ومافي ديبق يطلع اصلا @N3xT 1 hour ago, N3xT said: قاعد اجرب حركة, ومدري اذا بتظبط ولا لا لكن جرب الكود ورد علي executeSQLQuery("CREATE TABLE IF NOT EXISTS 3ajel ( myText TEXT, playerName TEXT )")addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", message ) if ( getElementData ( player, "Name" ) and getElementData ( player, "Name" ) ~= false ) then setElementData ( resourceRoot, "By_", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) endend)function myEvents () if ( eventName == "onResourceStop" ) then if ( getElementData ( resourceRoot, "Msg_" ) ~= "" and getElementData ( resourceRoot, "By_" ) ~= "" ) then local result = executeSQLQuery ( 'SELECT * FROM 3ajel' ) if ( #result == 0 ) then executeSQLQuery("INSERT INTO 3ajel ( myText, playerName ) VALUES( ?, ? )", getElementData ( resourceRoot, "Msg_" ) , getElementData ( resourceRoot, "By_" ) ) else executeSQLQuery("UPDATE 3ajel SET myText=?, playerName=?", getElementData ( resourceRoot, "Msg_" ), getElementData ( resourceRoot, "By_" ) ) end end elseif ( eventName == "onResourceStart" ) then local result = executeSQLQuery ( 'SELECT * FROM 3ajel' ) if ( #result ~= 0 ) then setElementData ( resourceRoot, "Have_", true ) setElementData ( resourceRoot, "Msg_", result[1].myText ) setElementData ( resourceRoot, "By_", result[1].playerName ) end endendaddEventHandler("onResourceStop", root, myEvents) addEventHandler("onResourceStart", root, myEvents) طيب شوف اسحب علي القاعدة الحين كيف اسوي لو الشخص اسمه #ffffff ما يحط اسمه بالعاجل؟ Link to comment
Mr.Mostafa Posted June 23, 2018 Author Share Posted June 23, 2018 كدا ؟ @N3xT addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_22", true ) setElementData ( resourceRoot, "Msg_22", message ) if ( getPlayerName(player) == "#ffffff" ) then setElementData ( resourceRoot, "By_22", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_22", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) end end) يب تمام ظبطت ان يجي الاسم مخفي لو اسمي #ffffff طيب كيف اخليه يجي مخفي لو اسمي فيه اي كود لون غير الابيض مثلا #ff0000 #ff00ff اي كود لون وش التحقق حقه ؟ Link to comment
TOUNSI |, السعأدة Posted June 23, 2018 Share Posted June 23, 2018 هههههههههههههههه وش طلبتك بظبط لـ انو ماني فاهم منك شيء بدك لما تسوي رستار للعاجل الكلام يضل موجود ؟ Link to comment
#Major . Posted June 23, 2018 Share Posted June 23, 2018 1 hour ago, Mr.Mostafa said: كدا ؟ @N3xT addCommandHandler("AdminMsg", function ( player, cmd, ... ) if not ( isGuestAccount ( getPlayerAccount ( player ) ) ) then if ( isPlayerAdmin ( player ) ) then local msg = {...} local message = table.concat(msg, " ") setElementData ( resourceRoot, "Have_22", true ) setElementData ( resourceRoot, "Msg_22", message ) if ( getPlayerName(player) == "#ffffff" ) then setElementData ( resourceRoot, "By_22", getElementData ( player, "Name" )) else setElementData ( resourceRoot, "By_22", getPlayerName ( player )) end else outputChatBox("* You Are Not Admin !", player, 255, 0, 0, true) end else outputChatBox("* Please Login !", player, 255, 0, 0, true) end end) يب تمام ظبطت ان يجي الاسم مخفي لو اسمي #ffffff طيب كيف اخليه يجي مخفي لو اسمي فيه اي كود لون غير الابيض مثلا #ff0000 #ff00ff اي كود لون وش التحقق حقه ؟ string.gusb 2 Link to comment
Master_MTA Posted June 24, 2018 Share Posted June 24, 2018 https://forum.multitheftauto.com/topic/93298-executesqlquery-شرح-ل/ 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