Jump to content

مشكلة اللفل


Recommended Posts

السلام عليكم ورحمة الله وبركاته

كيفكم؟

الصورة الاولية
 Sاحرف الـ
في الخريطة تعبر عن المدرسة

21214.png


الصورة الثانية

دفع التسجيل في المدرسة

21215.png

الصورة الثالثة

شرح الاستاذ على السبورة وطرح الاسئلة

21217.png

الصورة الرابعة

الطلاب والاجابة على اسئلة الاستاذ في مسابقة مستوى

21218.png

في مشكلة عندي في عمل المستوى  وحفظها من يستطيع مساعدتي ؟

وشكرا لكم

Edited by TAPL
  • Like 1
Link to comment
On 10/9/2016 at 9:06 PM, medo7 said:

السلام عليكم ورحمة الله وبركاته

كيفكم؟

الصورة الاولية
 Sاحرف الـ
في الخريطة تعبر عن المدرسة

21214.png


الصورة الثانية

دفع التسجيل في المدرسة

21215.png

الصورة الثالثة

شرح الاستاذ على السبورة وطرح الاسئلة

21217.png

الصورة الرابعة

الطلاب والاجابة على اسئلة الاستاذ في مسابقة مستوى

21218.png

في مشكلة عندي في عمل المستوى  وحفظها من يستطيع مساعدتي ؟

وشكرا لكم

انا اللي فهمتو انك تبي تسوي مستوى

شوف انت بتسوي لما اللاعب يسوي الحل اذا كان صح

يعطيه داتا مثلا اسمها Clever

بتصير كذا

setElementData(source, "Clever", (getElementData(source, "Clever") or 0) + 1)

تمام كذا 

و عشان يحفظ المستوي بتحط هاذي الاكواد بس استبدل Clever

مكان Missile

بيصير يحفظ المستوي حق اللاعب لما يطلع و يخش ..

هاذا الفهمتو ياريت اكون فهمت صح .

 



addEventHandler('onPlayerQuit',root,function()
    local Missile_Acc = getPlayerAccount(source)
    local MissileData = getElementData(source,'Missile')
     if ( MissileData ) then
       if ( Missile_Acc ) and not isGuestAccount ( Missile_Acc ) then
             setAccountData(Missile_Acc,'MissileData',MissileData)
         end
      end
   end
) 
 
addEventHandler('onPlayerLogin',root,function(_,acc)
    local MissileC_DATA = getAccountData(acc,'MissileData')
        if ( MissileC_DATA ) then
            setElementData(source,'Missile',MissileC_DATA)
        end
    end
)
 
   function NewMissile ()
 local MissileC_DATA = getAccountData(acc,'MissileData')
        if ( MissileC_DATA ) then
            setElementData(source,'Missile',MissileC_DATA)
        
    end
end

addEventHandler('onPlayerSpawn',root,NewMissile)

 

Link to comment

-- كلنت

    addEventHandler("onClientResourceStart", resourceRoot,
    function()
	
-- admin Question
        quizWindow = guiCreateWindow(232, 277, 382, 210, "Quiz Admin", false)
guiSetVisible(quizWindow, false)
        Questionlabel = guiCreateLabel(10, 24, 79, 27, "Question:", false, quizWindow)
        Questionedit = guiCreateEdit(79, 22, 215, 25, "", false, quizWindow)
        AdminAnswerlabel = guiCreateLabel(20, 84, 79, 27, "Answer:", false, quizWindow)
        AdminAnsweredit = guiCreateEdit(79, 84, 215, 25, "", false, quizWindow)
        AdminAnswerButton = guiCreateButton(105, 144, 131, 34, "set", false, quizWindow)
        AdminGetAnswerButton = guiCreateButton(284, 125, 83, 35, "Get Answer", false, quizWindow)
        AdminLevelButton = guiCreateButton(284, 165, 83, 35, "Level", false,quizWindow)
---Admin GetAnswerButton
        GetAnswerWindow = guiCreateWindow(537, 245, 215, 294, "Get Answer", false)
guiSetVisible(GetAnswerWindow, false)
        GetAnswerGridlist = guiCreateGridList(9, 27, 196, 235, false, GetAnswerWindow)
        guiGridListAddColumn(GetAnswerGridlist, "Name", 0.3)
        guiGridListAddColumn(GetAnswerGridlist, "Answer", 0.3)
				for i = 1,30 do
		name =	getPlayerName(source)
		 local Adminanswer = guiGetText(AdminAnsweredit)  -- admin answer
         local answer = guiGetText(answerEdit)  -- guys answer
       if (string.lower(Adminanswer) == string.lower(answer)) then
        guiGridListAddRow(GetAnswerGridlist)
        guiGridListSetItemText(GetAnswerGridlist, 0, 1, i.."- "..name, false, false)
        guiGridListSetItemText(GetAnswerGridlist, 0, 2, answer, false, false)
		end
		end
        GetAnswerButtonX= guiCreateButton(58, 263, 92, 21, "X", false, GetAnswerWindow)	
--- Admin Level
        AdminLevelWindow = guiCreateWindow(537, 245, 215, 294, "Level", false)
guiSetVisible(AdminLevelWindow, false)
        AdminLevelGridlist = guiCreateGridList(9, 27, 196, 235, false, AdminLevelWindow)
        guiGridListAddColumn(AdminLevelGridlist, "Name", 0.3)
        guiGridListAddColumn(AdminLevelGridlist, "Score", 0.3)
        guiGridListAddColumn(AdminLevelGridlist, "Level", 0.3)
   		for i = 1,30 do
		name =	getPlayerName(source)
		ScoreGuy = getElementData(source, "ScoreGuy")
		LevelGuy = getElementData(source, "LevelGuy")
		guiGridListAddRow(AdminLevelGridlist)
        guiGridListSetItemText(AdminLevelGridlist, 0, 1, i.."- "..name, false, false)
        guiGridListSetItemText(AdminLevelGridlist, 0, 2, ScoreGuy, false, false) --Score
        guiGridListSetItemText(AdminLevelGridlist, 0, 3, LevelGuy, false, false) --level
		end
        AdminLevelButtonX = guiCreateButton(58, 263, 92, 21, "X", false, AdminLevelWindow)   
        

---------------
-- guy answers
        answerWindow = guiCreateWindow(132, 296, 419, 193, "set Answer", false)
guiSetVisible(answerWindow, false)		
        Scorelabel = guiCreateLabel(12, 27, 76, 27, "Score:", false, answerWindow)
        Levellabel = guiCreateLabel(12, 54, 76, 27, "your Level :", false, answerWindow)
        answerEdit = guiCreateEdit(88, 96, 278, 36, "", false,answerWindow)
        TextAnswerlabel = guiCreateLabel(12, 100, 76, 27, "Text Answer:", false,answerWindow)
        answerButton = guiCreateButton(139, 153, 131, 30, "set", false, answerWindow)
	    LevelAnswerButton = guiCreateButton(12, 153, 131, 30, "Level", false, answerWindow)
-- LevelAnswerButton
        LevelWindow = guiCreateWindow(537, 245, 215, 294, "Level", false)
guiSetVisible(LevelWindow, false)
        LevelGridlist = guiCreateGridList(9, 27, 196, 235, false, LevelWindow)
        guiGridListAddColumn(LevelGridlist, "Name", 0.3)
        guiGridListAddColumn(LevelGridlist, "Score", 0.3)
        guiGridListAddColumn(LevelGridlist, "Level", 0.3)
				for i = 1,30 do
			name =	getPlayerName(source)
		ScoreGuy = getElementData(source, "ScoreGuy")
		LevelGuy = getElementData(source, "LevelGuy")
        guiGridListAddRow(LevelGridlist)
        guiGridListSetItemText(LevelGridlist, 0, 1, i.."- "..name, false, false)
        guiGridListSetItemText(LevelGridlist, 0, 2, ScoreGuy, false, false) --Score
        guiGridListSetItemText(LevelGridlist, 0, 3, LevelGuy, false, false) --level
		end
        LevelButtonX = guiCreateButton(58, 263, 92, 21, "X", false, LevelWindow)       		
        
    end
)

AdminLevel = {
{10,1}, 
{20,2},
{30,3},
{40,4},
{50,5},
--....-- {Score,Level}
}

addEventHandler("onClientGUIClick", root,
function (button,stat)
    if (source == AdminAnswerButton ) then  -- Admin question!
local Adminanswer = guiGetText(AdminAnsweredit)
local AdminQuestion = guiGetText(Questionedit)   
setTimer(function() guiCreateLabel(30, 24, 179, 127, AdminQuestion, false) guiSetVisible(quizWindow, false) showCursor(guiGetVisible(quizWindow))  end,3000,1)

    elseif (source == AdminGetAnswerButton) then -- Admin Get Answer
	guiSetVisible(GetAnswerWindow, true)
	for i = 1,30
       triggerServerEvent("GetAnswer", localPlayer, name,answer)
	    guiGridListAddRow(AdminLevelGridlist)
        guiGridListSetItemText(AdminLevelGridlist, 0, 1, i.."- "..name, false, false)
        guiGridListSetItemText(AdminLevelGridlist, 0, 2, answer, false, false)
      end
	  
    elseif (source == AdminLevelButton) then  -- Admin Level
        guiSetVisible(AdminLevelWindow, true)
		for i = 1,30 do
	 triggerServerEvent("LevelAnswer", localPlayer,name,ScoreGuy,LevelGuy)	
		guiGridListAddRow(AdminLevelGridlist)
        guiGridListSetItemText(AdminLevelGridlist, 0, 1, i.."- "..name, false, false)
        guiGridListSetItemText(AdminLevelGridlist, 0, 2, ScoreGuy, false, false) --Score
        guiGridListSetItemText(AdminLevelGridlist, 0, 3, LevelGuy, false, false) --level
		end

 elseif (source == answerButton) then -- Guys answ
 local Adminanswer = guiGetText(AdminAnsweredit)   -- admin answer
local answer = guiGetText(answerEdit)  -- guys answer
if (string.lower(Adminanswer) == string.lower(answer)) then
setElementData(source, "ScoreAnsw", 0 >~ AdminLevel[1][1]) + 1
setElementData(source, "LevelAnsw", 0 > AdminLevel[2][1]) + 1
--setElementData(source, "Clever", (getElementData(source, "Clever") or 0) + 1)
end
		
	   elseif (source == LevelAnswerButton) then  -- guys Level
        guiSetVisible(LevelWindow, true)
   		for i = 1,30 do
		triggerServerEvent("LevelAnswer", localPlayer,name,ScoreGuy,LevelGuy)
		guiGridListAddRow(LevelGridlist)
        guiGridListSetItemText(LevelGridlist, 0, 1, i.."- "..name, false, false)
        guiGridListSetItemText(LevelGridlist, 0, 2, ScoreGuy, false, false) --Score
        guiGridListSetItemText(LevelGridlist, 0, 3, LevelGuy, false, false) --level
		end  
	   
    elseif (source == GetAnswerButtonX) then  -- close GetAnswer = admin
        guiSetVisible(GetAnswerWindow, false)
        showCursor(guiGetVisible(GetAnswerWindow))  
    elseif (source == AdminLevelButtonX) then  -- close Level = admin
        guiSetVisible(AdminLevelWindow, false)
        showCursor(guiGetVisible(AdminLevelWindow))
    elseif (source == LevelButtonX) then  -- close Level = guys
        guiSetVisible(LevelWindow, false)
        showCursor(guiGetVisible(LevelWindow))		
		
    end
end)


bindKey("F2","down",function() -- admin f2
	guiSetVisible(quizWindow,not guiGetVisible(quizWindow)) 
	showCursor(guiGetVisible(quizWindow))
end
)

bindKey("F3","down",function() -- answer f3
	guiSetVisible(answerWindow,not guiGetVisible(answerWindow)) 
	showCursor(guiGetVisible(answerWindow)) 
end
)

--سيرفر

addEvent("GetAnswer", true)
addEventHandler("GetAnswer", root, 
function(name,answer)
name = getPlayerName(name)
answer = ""
end
)

addEvent("LevelAnswer", true)
addEventHandler("LevelAnswer", root, 
function(name,ScoreGuy,LevelGuy)
name = getPlayerName(name)
ScoreGuy = getElementData(source, "ScoreAnsw")
LevelGuy = getElementData(source, "LevelAnsw")
end
)
Spoiler
22 hours ago, M[A]X said:

انا اللي فهمتو انك تبي تسوي مستوى

شوف انت بتسوي لما اللاعب يسوي الحل اذا كان صح

يعطيه داتا مثلا اسمها Clever

بتصير كذا



setElementData(source, "Clever", (getElementData(source, "Clever") or 0) + 1)

تمام كذا 

و عشان يحفظ المستوي بتحط هاذي الاكواد بس استبدل Clever

مكان Missile

بيصير يحفظ المستوي حق اللاعب لما يطلع و يخش ..

هاذا الفهمتو ياريت اكون فهمت صح .

 



addEventHandler('onPlayerQuit',root,function()
    local Missile_Acc = getPlayerAccount(source)
    local MissileData = getElementData(source,'Missile')
     if ( MissileData ) then
       if ( Missile_Acc ) and not isGuestAccount ( Missile_Acc ) then
             setAccountData(Missile_Acc,'MissileData',MissileData)
         end
      end
   end
) 
 
addEventHandler('onPlayerLogin',root,function(_,acc)
    local MissileC_DATA = getAccountData(acc,'MissileData')
        if ( MissileC_DATA ) then
            setElementData(source,'Missile',MissileC_DATA)
        end
    end
)
 
   function NewMissile ()
 local MissileC_DATA = getAccountData(acc,'MissileData')
        if ( MissileC_DATA ) then
            setElementData(source,'Missile',MissileC_DATA)
        
    end
end

addEventHandler('onPlayerSpawn',root,NewMissile)

 

مو عارف كيف احفظ السيفر في كلنت ؟؟



Link to comment

سؤال ؟

--- كلنت
gLevel = {
{10,1}, -- {Score,Level}
{20,2},
{30,3},
{40,4},
{50,5},
{60,6},
}

addEvent ("windowLevel", true)
addEventHandler ("windowLevel", root,
function()

getElementData(source,'Score')

getElementData(source,'level')

end)

addEventHandler("onClientGUIClick", root,
function (button,stat)
     if (source == AdminAnswerButton ) then  -- Admin question!
      if (string.lower(Adminanswer) == string.lower(answer)) then

setElementData(source,'Score',0 > gLevel[1])
setElementData(source,'level',0 > gLevel[2])

end

end
end)


--- server
function saveDataLevel()
local Missile_Acc = getPlayerAccount(source)
local MissileData = getElementData(source,'level')
if ( MissileData ) then
if ( Missile_Acc ) and not isGuestAccount ( Missile_Acc ) then
setAccountData(Missile_Acc,'MissileData',MissileDa ta)
triggerClientEvent ( Missile_Acc, "windowLevel", MissileData)
end
end
end
addEventHandler('onPlayerLogin',root,saveDataLevel )

Edited by medo7
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...