Jump to content

brunob22

Members
  • Posts

    159
  • Joined

  • Last visited

Everything posted by brunob22

  1. sim isso msm o debug teria q me retorna alguma numeros.. como ex nesse q funciona muito bem function inventariocarro () guiGridListClear(gridlist["carros_inventario"]) local x = guiGridListGetItemText(gridlist["carros"], guiGridListGetSelectedItem(gridlist["carros"]), 2) local y = guiGridListGetItemText(gridlist["carros"], guiGridListGetSelectedItem(gridlist["carros"]), 3) local z = guiGridListGetItemText(gridlist["carros"], guiGridListGetSelectedItem(gridlist["carros"]), 4) local vehicles = getElementsByType("vehicle") local row002 = guiGridListAddRow(gridlist["carros_inventario"]) guiGridListSetItemText(gridlist["carros_inventario"], row002, gridlist["carros_colunainv"], "Primarias",true,false) for index , vehicles01 in ipairs(vehicles) do local rx,ry,rx = getElementPosition(vehicles01) if tostring(ry) == tostring(y) then local idcarro = getElementModel(vehicles01) for index , items in ipairs(itemsdatatable["Primaria"]) do local item = getElementData(getElementData(vehicles01, "parent"), items[1]) if item then if item >= 1 then ItemId = createIdForItem(items[1]) local itemName = createItemForId(ItemId) local row = guiGridListAddRow(gridlist["carros_inventario"]) guiGridListSetItemText(gridlist["carros_inventario"], row, gridlist["carros_colunainv"], itemName, false,false) guiGridListSetItemText(gridlist["carros_inventario"], row, gridlist["carros_quantia"], item, false,false) end end end end end end e assim nesse codigo " item " me retorna uma serie de numeros em local tnt = getElementData(col,"Armabox") o debug me retorna verdadeiro entendeu?
  2. alguem poderia me dizer oq isso ta errado? pq o resultado sem volta false ai esta o codigo function inventarioarmabox01 () local x = guiGridListGetItemText(gridlist["armabox1"], guiGridListGetSelectedItem(gridlist["armabox1"]), 1) for i, col in ipairs(getElementsByType("colshape")) do local tnt = getElementData(col,"Armabox") if tnt then local rx,ry,rz = getElementPosition(col) if tostring(rx) == tostring(x) then for index , items in ipairs(itemsdatatable["Primaria"]) do local item = getElementData(getElementData(col, "parent"), items[1]) --guiGridListSetItemText(gridlist["armabox1_inventario"], row, gridlist["armabox1_inventario_coluna"], itemName, false,false) outputChatBox(tostring(item)) --[[for index , items in ipairs(itemsdatatable["Segundaria"]) do local item = getElementData(getElementData(TheTent, "parent"), items[1]) if item then if item >= 1 then ItemId = createIdForItem1(items[1]) local itemName = createItemForId1(ItemId) local row = guiGridListAddRow(gridlist["armabox1_inventario"]) guiGridListSetItemText(gridlist["armabox1_inventario"], row, gridlist["armabox1_inventario_coluna"], itemName, false,false) end end end]] end end end end end addEventHandler("onClientGUIClick",getRootElement(),inventarioarmabox01) tabela: itemsdatatable = { ["Primaria"] = { {"M4A1",3}, {"L115A1 LRR",3}, {"Winchester 1866",3}, {"SPAZ-12 Combat Shotgun",3}, {"Sawn-Off Shotgun",3}, {"AK-47",3}, {"Lee Enfield",3}, }, ["Segundaria"] = { {"M4A1",3}, {"L115A1 LRR",3}, {"Winchester 1866",3}, {"SPAZ-12 Combat Shotgun",3}, {"Sawn-Off Shotgun",3}, {"AK-47",3}, {"Lee Enfield",3}, }, ["Others"] = { {"M4A1",3}, {"L115A1 LRR",3}, {"Winchester 1866",3}, {"SPAZ-12 Combat Shotgun",3}, {"Sawn-Off Shotgun",3}, {"AK-47",3}, {"Lee Enfield",3}, }, } eu sei que a tabela ta todo igual mais isso e so pra ter controle...
  3. kkkk sorry agora entendi oque voce falo me descupe kkk mudei para isso function inserirnagridlist () for index , tablea in ipairs(carros) do local idrow2 = math.random(1,999) local tabela01 = table.concat(tablea) outputChatBox(tabela01) guiGridListSetItemText(gridlistitems, idrow2, 1,tabela01,false,false) end end e agora ele funciona muito bem
  4. guiGridListSetItemText(gridlistitems, 1, 1,tabela01,false,false) guiGridListSetItemText(gridlistitems, 2, 1,tabela01,false,false) guiGridListSetItemText(gridlistitems, 3, 1,tabela01,false,false) se eu fizer assim.. ele gera 3 linha do ultimo valor da tabela ex: 1 2 3 4 entao ele vai mostra 3 vezes o numero 4 guiGridListSetItemText(gridlistitems, row, 1,tabela01,false,false) e assim com a row certa.. tb fica do msm jeito que o primeiro la.. so mostra o ultimo valor.. e do jeito que eu botei ali e so pra gera valores alearios para fila.
  5. Quando vai aprender respeitar os usuários, #RooTs? Você que se decide, se vai frequentar o fórum pra ajudar ou pra causar brigas. Isso só vai gerar problemas pra si próprio. On topic Acho que os exemplos já servem muito bem, já que ele mesmo disse que já fez um sistema de level e exp, então deve entender os exemplos com mais facilidade. me desculpe me meter aki mais essa q esse RooTz ja devia ter ido ban .. nao ea primeira vez.. nem a ultima comigo e mais em baixo se ele falta com respeito comigo eu simplesmente reporto a postagem dele mais se ele nao tomo ban ainda ja e desição sua eu somente expus minha opnião
  6. gente to com pegueno problema akii function inserirnagridlist () local idrow2 = math.random(1,999) for index , tablea in ipairs(carros) do local tabela01 = table.concat(tablea) outputChatBox(tabela01) guiGridListSetItemText(gridlistitems, idrow2, 1,tabela01,false,false) end end o codigo ta funfando e tals.. mais em guiGridListSetItemText(gridlistitems, idrow2, 1,tabela01,false,false) ele ta apenas mostrando o ultimo item da tabela ex: se nao tabela carros tem 1 2 3 4 na gridlist ele so vai mostrar o 4 mais no outchatbox ele mostra todos os valores alguem pode me dizer o errado? obs: não posso postar o codigo todo lamento =(
  7. em vez de verifica se e ped voce pode usar para verifica se e zombie o mod mta dayz seta um elemento para o ped zombie =) bjs prates.
  8. function conectado () db = dbConnect( "sqlite","bancodedados.db" ) end addEventHandler( "onResourceStart", getRootElement( ),conectado) function inserirdados (source,q) dbQuery(db, "DROP TABLE dadoplayer") dbQuery(db, "CREATE TABLE IF NOT EXISTS dadoplayer (id,nomejogador,dinheiro)" ) local name = getPlayerName(source) local dinheiro = getPlayerMoney(source) local id = math.random(1,9999) outputChatBox(name) local db2 = dbQuery(db, "INSERT INTO dadoplayer (id,nomejogador,dinheiro) VALUES(?,?,?)",id,name,dinheiro ) end addCommandHandler( "salvar", inserirdados) function loaddinheiro (id,nomejogador,dinheiro) givePlayerMoney(nomejogador,dinheiro) outputChatBox("OK CARREGADOS") end function carregar (q) if (q) then local p = dbPoll( q, 0) for i, dados in pairs( p ) do loaddinheiro(dados["id"] ,dados["nomejogador"],dados["dinheiro"]); outputChatBox( "OK" ) end end end function carregar1 () dbQuery(carregar, { }, db, "SELECT * FROM dadoplayer") end addCommandHandler( "carrega", carregar1) to com problema na linha 20 que seria givePlayerMoney(nomejogador,dinheiro) alguem pode me dar um help?
  9. por isso acho bom coloka o time entende? bom se quizer da uma olhada me add no skype la b2darkorbit
  10. sim to trocando o serial.. como falei acho que o timer resolve.. mais eu nao sei leva o source para a função q foi chamada pelo timer.
  11. na minha opnião o codigo devia fica assim... serials = { ["0000000000000000000000000000000"] = true, } function onPlayerLogin() if serials[getPlayerSerial(source)] then setElementData(source, "MAX_Slots",-1) --outputDebugString(getElementData(source,"MAX_Slots")) outputChatBox("OK VOCE TA LOGADO") local slotsplayers = getElementData(source, "MAX_Slots") outputChatBox(slotsplayers) end end function delaytimefunction () setTimer(onPlayerLogin,2000,1) end addEventHandler("onPlayerLogin",root,delaytimefunction) mais eu to meio q apredendo ainda.. entao da erro na linha 6 q seria o getplayerserial
  12. oque ta aconteceu meu amigo eo seguinte.. nao da erro nem coisa do genero. e simplesmente nao acontece nada. entendeu?
  13. se não for isso então você é burro ok toma o meu report ai lindao =)
  14. serio isso voce ta de brincadeira ou oque?
  15. nao funciono amigo sim ta em lado servidor.
  16. alguem podera me ajudar? pq nenhum dos codigos funciono
  17. bom o seu primeiro retorno no chat userdata: 00005876 mais nao foi aplicado o setelement
  18. nao da erro nenhum mais tb nao acontece nada ,, o setelementdata continua nao aplicando ..
  19. serials = { {"01",2}, {"02",2} } function banotrotipo (player) for i , playerserial in ipairs(serials) do outputChatBox(tostring(playerserial[1])) local serialdoplayer = getPlayerSerial(source) local accountaplayer = getPlayerAccount(source) if (serialdoplayer == playerserial[1]) then if player then setElementData(player, "MAX_Slots", -1) outputChatBox(tostring(player)) end end end end --function punisao () --setElementData(source, "MAX_Slots", -1) --end addEventHandler( "onPlayerLogin",getRootElement(),banotrotipo,source) o erro que da e em setElementData(player, "MAX_Slots", -1) o resto esta funcionando so tirei o serial dali de cima para evitar coloka aki =)
  20. o meta.lua nao vai para o pc do cara.. quaso voce tiver otro que vai.. use o cache off
  21. obrigado pela ajuda eu achei q para cria tabela precisava do for e do ipairs junto.. mais percebi que o for eo ipairs e se eu quizer que leia a tabela toda de 1 vez so?
  22. Olá a todos.. to com problema com o math.random.. nao sei aplicar ele em uma tabela vou mostra o codigo abaixo oque acontece. spawns = { {-2142.9504394531,-2356.3515625,37.765151977539}, {-2142.9504394531,-2356.3515625,50.765151977539}, } function scriptdetest () for i,points in ipairs(spawns) do local points2 = spawns [ math.random( #spawns) ] local x,y,z = points2[1],points2[2],points2[3] --createVehicle(548,x,y,z,nil,nil,nil) outputChatBox(points2[3]) end outputChatBox( "OK SUCESSO" ) end addCommandHandler( "eventoon", scriptdetest ) como podem ver na imagem as vezes ele muda o numero mais sempre os 2 valors da tabela quero fazer ele gera apenas 1 valor da tabela e sim as 2 cord sao igual.. eu so mudei o Z para ter maior controle..
  23. I can not sorry What do I want to do and delete the car that was selected in gridlist over the past codes above does not delete the car if you have more than two in the same car spawn
  24. you code dont work. no erro. change code.. addEvent("b2.deletarcarro", true) addEventHandler("b2.deletarcarro", getRootElement(), function(deletarcarro1,xx,yy,zz) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then if deletarcarro1 then for i , v in pairs (getElementsByType("vehicle")) do if getElementModel (v) == getVehicleModelFromName (tostring (deletarcarro1)) then local x,y,z = getElementPosition( v ) if x == tonumber(xx) or y == tonumber(yy) or z == tonumber(zz) then destroyElement(v) end end end end end end) punch it only deletes if you have one car on spawn But, this is not what you want? not 'cause if you have 2 car in the spawn not delete
×
×
  • Create New...