Kenix Posted April 18, 2011 Share Posted April 18, 2011 adds only 1 instead of 2 bindKey ("F5", "down", function() if (guiGetVisible(MainWindowLevel) == false) then guiSetVisible(MainWindowLevel,true) showCursor(true) if (skillsID) then local ids = split(getElementData(getLocalPlayer(),"SkillBought"), string.byte(';')) for lol, id in ipairs(ids) do if (id == tonumber(skillsID)) then outputChatBox("get element data") local textAddSkill = guiGridListSetItemText(MainGrid,tonumber(skillsID),5,"purchased",false,false) local textAddSkill2 = guiGridListSetItemColor (MainGrid,tonumber(skillsID),5,0,255,0) outputChatBox("text add "..tostring(textAddSkill).." , "..tostring(textAddSkill2).." , "..tostring(getElementData(getLocalPlayer(),"SkillBought")).."") end end end elseif (guiGetVisible(MainWindowLevel) == true) then guiSetVisible(MainWindowLevel,false) showCursor(false) end end ) Link to comment
Castillo Posted April 18, 2011 Share Posted April 18, 2011 Kidding me? that's all what you need to say?? Post information about the ERROR. Link to comment
Kenix Posted April 19, 2011 Author Share Posted April 19, 2011 there is a problem because set / get elementdata for example "SkillBought" and for example the number 1 but how to save a set of numbers in a date?? do not save as for example 30 different dates .... please help with these misunderstandings. function itself gets level, money, ID skill. function getSkillFunc(player,data,cashs,Levelids) if (getElementData(player,"Level") >= tonumber(data)) then outputChatBox("уровень подходит") if (getPlayerMoney (player) >= tonumber(cashs)) then takePlayerMoney (player,cashs) outputChatBox("деньги подходят") if (Levelids) then outputChatBox("отправлен к клиенту") triggerClientEvent(player, "selectSkill", getRootElement(), Levelids) return true else return false end end end end used as getSkillFunc(source,0,1,0) client event: addEvent("selectSkill",true) addEventHandler( "selectSkill", getLocalPlayer(), function(skillsIDIn) skillsID = skillsIDIn if (tonumber(skillsID)) then guiGridListSetItemText(MainGrid,tonumber(skillsID),5,"purchased",false,false) guiGridListSetItemColor (MainGrid,tonumber(skillsID),5,0,255,0) local datasSk = setElementData(getLocalPlayer(),"SkillBuy",skillsID) outputChatBox("set data skill "..tostring(skillsID).." , "..tostring(datasSk)) outputChatBox("text change "..tonumber(skillsID)) end end ) use here bindKey ("F5", "down", function() if (guiGetVisible(MainWindowLevel) == false) then guiSetVisible(MainWindowLevel,true) showCursor(true) if (skillsID) then if (getElementData(getLocalPlayer(),"SkillBuy") == tonumber(skillsID)) then -- at all necessary to get as ever from a single date if they meet a lot of numbers for example if there is a number 1 and 2, then set text in row 1 and 2))) outputChatBox("get element data") local textAddSkill = guiGridListSetItemText(MainGrid,tonumber(skillsID),5,"purchased",false,false) local textAddSkill2 = guiGridListSetItemColor (MainGrid,tonumber(skillsID),5,0,255,0) outputChatBox("text add "..tostring(textAddSkill).." , "..tostring(textAddSkill2).." , "..tostring(getElementData(getLocalPlayer(),"SkillBuy")).."") end end elseif (guiGetVisible(MainWindowLevel) == true) then guiSetVisible(MainWindowLevel,false) showCursor(false) end end ) 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