Jump to content

مساعدة


Recommended Posts

شباب ايش الأخطاء بالكود؟

executeSQLQuery("CREATE TABLE IF NOT EXISTS serial (count TEXT, playerCounter TEXT, savedSerials TEXT, serialUsername TEXT)")

local counter = executeSQLQuery("SELECT count FROM playerCounter")
function onJoin()
	local serial = getPlayerSerial(source)
	if isUserNew(source) then
		local highs = call(getResourceFromName("Core"),"getOnlineHighs")
		local ccode = call(getResourceFromName("admin"),"getPlayerCountry",source)
		for i,v in ipairs(highs) do
		outputChatBox("* #FFFFFF"..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."#22a9ed has joined the game [New]", 0, 100, 0, true)
			outputChatBox("Player Number: "..("%03d"):format(counter[1].count),v)
			outputChatBox("Old Name: "..getPlayerName(source),v)
			outputChatBox("New Name: Guest_"..("%03d"):format(counter[1].count),v)
			outputChatBox("Country: "..call(getResourceFromName("Core"),"getCountryNameFromCode",ccode),v)
			outputChatBox("IP: "..getPlayerIP(source),v)
			outputChatBox("Serial: "..serial,v)
		end
		setPlayerName(source, "Guest_"..("%03d"):format(counter[1].count))
		executeSQLQuery("INSERT INTO savedSerials(serial) VALUES(?)",serial)
		executeSQLQuery("INSERT INTO serialUsername(serial,username) VALUES(?,?)",serial,"Guest_"..("%03d"):format(counter[1].count))
		outputChatBox("• Guest_"..("%03d"):format(counter[1].count).." #22a9edhas joined the game [#ffffffNew#22a9ed]",root,255,255,255,true)
		executeSQLQuery("UPDATE playerCounter SET count=? WHERE count=?",counter[1].count + 1,counter[1].count)
		counter = executeSQLQuery("SELECT count FROM playerCounter")
		executeSQLQuery("INSERT INTO serialReputation(serial,reputation) VALUES(?,?)",serial,0)
		setElementData(source,"Reputation",0)
	else
		local q = executeSQLQuery("SELECT username FROM serialUsername WHERE serial=?",serial)
		setPlayerName(source,q[1].username)
		if muted[serial] then
			outputChatBox("• "..q[1].username.." #22a9edhas joined the game [#FFFFFFMuted#22a9ed]",root,255,255,255,true)
		else
			outputChatBox("• "..q[1].username.." #22a9edhas joined the game",root,255,255,255,true)
		end
		local q = executeSQLQuery("SELECT reputation FROM serialReputation WHERE serial=?",serial)
		setElementData(source,"Reputation",q[1].reputation or 0)
	end
end
addEventHandler("onPlayerJoin",root,onJoin)

 

Link to comment

 

مع اسم الجدول في كل شي column مشكلتك بسيطة وهي انك عكست الـ

 19 يعني كمثال سطر

executeSQLQuery("INSERT INTO serail(savedSerials) VALUES(?)",serial)

serial : اسم الجدول

savedSerials : اسم العمود

  NULL لازم تكون بهذي الطريقة, وللمعلومية لو سويت كذا باقي الأعمدة بتنضاف لها قيمة

 

Link to comment
On 01/04/2020 at 14:54, Sha67 said:

 

مع اسم الجدول في كل شي column مشكلتك بسيطة وهي انك عكست الـ

 19 يعني كمثال سطر


executeSQLQuery("INSERT INTO serail(savedSerials) VALUES(?)",serial)

serial : اسم الجدول

savedSerials : اسم العمود

  NULL لازم تكون بهذي الطريقة, وللمعلومية لو سويت كذا باقي الأعمدة بتنضاف لها قيمة

 

سويت زي ما قتلي و ما صار شي

حاولت أشوف ببرنامج DB Browser (SQLite)

لقيت الجدول فاضي

و كمان مافي مشاكل في الديبق

Link to comment
4 hours ago, Snakegold said:

ما أشوف اخطاء؟

local counter = executeSQLQuery("SELECT count FROM playerCounter") X
local counter = executeSQLQuery("SELECT count FROM serial")

executeSQLQuery("INSERT INTO savedSerials(serial) VALUES(?)",serial) X
executeSQLQuery("INSERT INTO serial(savedSerials) VALUES(?)",serial)

local q = executeSQLQuery("SELECT username FROM serialUsername WHERE serial=?",serial) X
local q = executeSQLQuery("SELECT serialUsername FROM serial WHERE savedSerials=?",serial)

وكل الباقية خطأ

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...