TwiX! Posted January 29, 2012 Share Posted January 29, 2012 (edited) Вообщем проблема такая, что оне не меняет тест и картинук когда игрок открывает панель.. Client function startGui --Тут бла бла бла создаётся сама панель callServerFunction("loadStats",getLocalPlayer()) end --end start gui addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), startGUI) Тут вот не работает function refreshPanelData(playerCash, mapsWonDD, mapsPlayedDD, winRatioDD, mapsWonDM, mapsPlayedDM, winRatioDM, hunters, mapBuys, AC,toptimes) if playerCash and mapsWonDD and mapsPlayedDD and winRatioDD and mapsWonDM and mapsPlayedDM and winRatioDM and hunters and mapBuys and AC and toptimes then ACADD = 0 for i=1,#AC do if AC[i] == 1 then ACADD = ACADD+1 guiLabelSetColor(Achievement[i],0,255,0) destroyElement(AchievementImages[i]) AchievementImages[i] = guiCreateStaticImage ( 0.75, 0.074+0.15*i, 0.15, 0.1, "images/unl.png",true,ScrollPane ) else guiLabelSetColor(Achievement[i],255,0,0) destroyElement(AchievementImages[i]) AchievementImages[i] = guiCreateStaticImage ( 0.75, 0.074+0.15*i, 0.15, 0.1, "images/loc.png",true,ScrollPane ) end end guiSetText ( myCashGUI, "Money: $"..playerCash.."" ) guiSetText ( myPlayedDMGUI, "DMs: "..mapsPlayedDM.."") guiSetText ( myWinsDMGUI, "Wins [DM]: "..mapsWonDM.."" ) guiSetText ( myRatioDMGUI, "Ramk [DM]: "..winRatioDM.."%") guiSetText ( myPlayedDDGUI, "DDs: "..mapsPlayedDD.."") guiSetText ( myWinsDDGUI, "Wins [DD]: "..mapsWonDD.."" ) guiSetText ( myRatioDDGUI, "Rank [DD]: "..winRatioDD.."%") guiSetText ( myHuntersGUI, "Hunters: "..hunters.."") guiSetText ( myMapBuysGUI, "Map Buys: "..mapBuys.."") guiSetText ( myACCountGUI, "Achievements: "..ACADD.."/15") guiSetText ( myTopTimesGUI, "Top Times: "..toptimes.."") else callServerFunction("loadStats",getLocalPlayer()) end end Server function loadStats(thePlayer) local playerCash = loadPlayerData(thePlayer,"cash") local mapsWonDD = loadPlayerData(thePlayer,"mapsWonDD") local mapsPlayedDD = loadPlayerData(thePlayer,"mapsPlayedDD") local mapsWonDM = loadPlayerData(thePlayer,"mapsWonDM") local mapsPlayedDM = loadPlayerData(thePlayer,"mapsPlayedDM") local hunters = loadPlayerData(thePlayer,"hunters") local mapBuys = loadPlayerData(thePlayer,"mapBuys") AC = {} for i=1,15 do AC[i] = loadPlayerData(thePlayer,"ac"..i) end local toptimes = loadPlayerData(thePlayer,"TopTimes") local winRatioDD = 0 if mapsPlayedDD == 0 and mapsWonDD == 0 then winRatioDD = 0 elseif mapsPlayedDD ~= 0 and mapsWonDD == 0 then winRatioDD = 0 elseif mapsPlayedDD ~= 0 and mapsWonDD ~= 0 then winRatioDD = math.round(((100/mapsPlayedDD)*mapsWonDD),2) elseif mapsWonDD > mapsPlayedDD then winRatioDD = 0 end local winRatioDM = 0 if mapsPlayedDM == 0 and mapsWonDM == 0 then winRatioDM = 0 elseif mapsPlayedDM ~= 0 and mapsWonDM == 0 then winRatioDM = 0 elseif mapsPlayedDM ~= 0 and mapsWonDM ~= 0 then winRatioDM = math.round(((100/mapsPlayedDM)*mapsWonDM),2) elseif mapsWonDM > mapsPlayedDM then winRatioDM = 0 end callClientFunction(thePlayer, "refreshPanelData" ,playerCash, mapsWonDD, mapsPlayedDD, winRatioDD, mapsWonDM, mapsPlayedDM, winRatioDM, hunters, mapBuys, AC,toptimes) end так же ошибок нет, ничего не происходит я хотел чтобы открытие панели, устанавливался текст сколько побед, денег и т.д Edited January 30, 2012 by Guest Link to comment
Kenix Posted January 29, 2012 Share Posted January 29, 2012 Ты проверь каждый кусочек кода. Что возвращает каждая переменная и т.д Link to comment
MX_Master Posted January 29, 2012 Share Posted January 29, 2012 Ты проверь каждый кусочек кода.Что возвращает каждая переменная и т.д второе прэдлаженице улэбнуло а ваще вряд ли мы поможем, потому что куски мелкие, а это все надо тестировать как целый ресурс. Если нет ошибок, значит ошибок нет в коде, только в логике кода. Link to comment
TwiX! Posted January 30, 2012 Author Share Posted January 30, 2012 callClientFunction и function refreshPanelData(thePlayer,playerCash, mapsWonDD, mapsPlayedDD, winRatioDD, mapsWonDM, mapsPlayedDM, winRatioDM, hunters, mapBuys, AC,toptimes) не правильно вызывал её,) спасиб за помощь Исправил код и 1 пост, он полностью рабочий теперь,тест ставится но картинка не меняется.. 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