حوير البلوي Posted February 25, 2013 Share Posted February 25, 2013 السلام عليكم ورحمة الله وبركاته مسيتو بالخير يالربع ياشباب معتازكم انكم تشوفون ذا الكود مدري وش بلاه local frozeTime = 60 -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", root, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do if (thePlayer ~= source) then setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", tonumber(frozeTime)) showTimeLeft(thePlayer) end end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if tonumber(getElementData(player, "Timeleft")) == 0 then textDestroyDisplay(timeLeft[player]) setElementFrozen(player, false) end end أخوكم sultanalbalawi Link to comment
][sojn][ Posted February 26, 2013 Share Posted February 26, 2013 طيب ممكن تقول لنا وش تبي تسوي بالظبط؟ Link to comment
MrCor Posted February 26, 2013 Share Posted February 26, 2013 السلام عليكم ورحمة الله وبركاتهمسيتو بالخير يالربع ياشباب معتازكم انكم تشوفون ذا الكود مدري وش بلاه local frozeTime = 60 -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", root, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do if (thePlayer ~= source) then setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", tonumber(frozeTime)) showTimeLeft(thePlayer) end end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if tonumber(getElementData(player, "Timeleft")) == 0 then textDestroyDisplay(timeLeft[player]) setElementFrozen(player, false) end end أخوكم sultanalbalawi هذا كود تبع شوب يجمد اللاعبين و يطلع الوقت في الشاشة وهذا الكود مسوي له ترايقر سيرفر , الكود صح مافيه شي شكلك ماخذه من شوب احد و اذا تبي تركبه على شوب ويش تبي نعدل ؟ Link to comment
][sojn][ Posted February 26, 2013 Share Posted February 26, 2013 الكود صح مافيه شيء بس يمكن هو ما يبي الي قلته يا مستر كور يمكن يبي شيء ثاني Link to comment
#Al-Ha[J]aRii Posted February 26, 2013 Share Posted February 26, 2013 (edited) السلام عليكم ورحمة الله وبركاتهمسيتو بالخير يالربع ياشباب معتازكم انكم تشوفون ذا الكود مدري وش بلاه local frozeTime = 60 -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", root, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do if (thePlayer ~= source) then setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", tonumber(frozeTime)) showTimeLeft(thePlayer) end end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if tonumber(getElementData(player, "Timeleft")) == 0 then textDestroyDisplay(timeLeft[player]) setElementFrozen(player, false) end end أخوكم sultanalbalawi لين تبي كود فريز جماعي للشوب Client Side ! addEventHandler("onClientGUIClick",guiRoot,function() if source == اسم الزر then triggerServerEvent("FrozenAll",localPlayer) end end) Server Side ! local timer = 5000 -- 1000 الوقت الي تبي ياخذون الاعبين فريز وبعدها ينفك الثانية addEvent("FrozenAll",true) addEventHandler("FrozenAll",getRootElement(), function() for i,v in ipairs (getElementsByType("player")) do setElementFrozen(v,true) setElementFrozen(source,false) setTimer(function() setElementFrozen(v,false) end,timer,1) end end) ملاحظة : ضيف السعرر للكود Edited February 26, 2013 by Guest Link to comment
Max+ Posted February 26, 2013 Share Posted February 26, 2013 ههههه بس ناقص Text Functions Link to comment
#Al-Ha[J]aRii Posted February 26, 2013 Share Posted February 26, 2013 ههههه بس ناقص Text Functions قصدك function() ? عدلتها فوقق ^ Link to comment
][sojn][ Posted February 26, 2013 Share Posted February 26, 2013 هو يبي الوقت الباقي لفك الفريز يظهر بالشاشه Link to comment
#Al-Ha[J]aRii Posted February 26, 2013 Share Posted February 26, 2013 هو يبي الوقت الباقي لفك الفريز يظهر بالشاشه اها Link to comment
#Al-Ha[J]aRii Posted February 26, 2013 Share Posted February 26, 2013 السلام عليكم ورحمة الله وبركاتهمسيتو بالخير يالربع ياشباب معتازكم انكم تشوفون ذا الكود مدري وش بلاه local frozeTime = 60 -- Seconds as frozen local timeLeft = {} local timeLeftText = {} addEvent("Froze", true) addEventHandler("Froze", root, function() if getPlayerMoney(source) >= 2000 then local players = getElementsByType("player") takePlayerMoney(source, 2000) outputChatBox("All players successfully frozen", source, 255, 255, 0, true) for theKey,thePlayer in ipairs(players) do if (thePlayer ~= source) then setElementFrozen(thePlayer, true) setElementData(thePlayer, "Timeleft", tonumber(frozeTime)) showTimeLeft(thePlayer) end end else outputChatBox("Not enough money.", source, 255, 0, 0, true) end end) function showTimeLeft(player) timeLeft[player] = textCreateDisplay() textDisplayAddObserver(timeLeft[player], player) timeLeftText[player] = textCreateTextItem("Time left: " .. getElementData(player, "Timeleft"), 0.45, 0.1, "high", 255, 255, 255, 255) textDisplayAddText(timeLeft[player], timeLeftText[player]) setTimer(updateTimeLeft, 1000, getElementData(player, "Timeleft"), player) end function updateTimeLeft(player) setElementData(player, "Timeleft", getElementData(player, "Timeleft") - 1) textItemSetText(timeLeftText[player], "Time left: " .. getElementData(player, "Timeleft")) if tonumber(getElementData(player, "Timeleft")) == 0 then textDestroyDisplay(timeLeft[player]) setElementFrozen(player, false) end end أخوكم sultanalbalawi عندك غلط في local frozeTime = 60 الثانية =1000 لين دقيقة 60000 انت تبي دقيقة لين دقيقة تصير كذآ local frozeTime = 60000 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