Jump to content

Funcion que falla.


SeMa™

Mensajes recomendados

Alguien puede arreglarme esta funcion?

 

El error está que cuando le doy a comprar item, se cierra la ventana de la quest, no chekea si el dinero que tengo es mayor o menor 

 

"if auktions_haus.get_money(pc.get_name()) > preis then"

 

y está justo despues de darle al boton comprar.

 

 

Gracias. y Saludos.

       function buy_item ( vnum, name, preis, verkaufer )            local sockets = mysql_query("SELECT socket1, socket2, socket3 FROM player.auktionshaus WHERE name = '"..name.."' and vnum = '"..vnum.."' and preis = '"..preis.."' and verkaufer = '"..verkaufer.."'")            local tabelle = {                [1] = sockets.socket1[1],                [2] = sockets.socket2[1],                [3] = sockets.socket3[1],            }            if verkaufer == pc.get_name() then                return chat("Usted no puede comprar su propio Item.")            end            say_size(350, 425)            say_title("Casa de Subastas:")            say_item_vnum(vnum)            say("Piedras:")            say("")            for i = 1, 3, 1 do                if tabelle[i] > 1 then                    say_reward(auktions_haus.stones(tabelle[i]))                else                    say("Ninguno")                end            end            say("")            say("Bonus:")            local bonis = mysql_query("SELECT attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3 FROM player.auktionshaus WHERE name = '"..name.."' and vnum = '"..vnum.."' and preis = '"..preis.."' and verkaufer = '"..verkaufer.."'")            if tonumber(bonis.attrtype0[1]) > 0 then                say_reward(auktions_haus.attr_list(tonumber(bonis.attrtype0[1])).." : "..bonis.attrvalue0[1])            else                say("Ninguno")            end            if tonumber(bonis.attrtype1[1]) > 0 then                say_reward(auktions_haus.attr_list(tonumber(bonis.attrtype1[1])).." : "..bonis.attrvalue1[1])            else                say("Ninguno")            end            if tonumber(bonis.attrtype2[1]) > 0 then                say_reward(auktions_haus.attr_list(tonumber(bonis.attrtype2[1])).." : "..bonis.attrvalue2[1])            else                say("Ninguno")            end            if tonumber(bonis.attrtype3[1]) > 0  then                say_reward(auktions_haus.attr_list(tonumber(bonis.attrtype3[1])).." : "..bonis.attrvalue3[1])            else                say("Ninguno")            end            say("¿Quieres comprar el Item?")            say_reward("Cuesta: "..preis.." yang.")            say("")            say("")            local a = select("Comprar", "Atrás")            if a == 1 then                if auktions_haus.get_money(pc.get_name()) > preis then                    tabelle = {}                    for i = 0, 39, 1 do                        table.insert(tabelle, i)                    end                    table.insert(tabelle, "Atrás")                    say_size(350, 375)                    say_title("Ranura selección Almacén:")                    say("Aquí se puede elegir en los artículos en el almacén")                    say("debería corresponder")                    c = select_table(tabelle)                    if c == table.getn(tabelle) then                         auktions_haus.menu()                    end                    local check = mysql_query("SELECT COUNT(*) as count FROM player.item WHERE window = 'SAFEBOX' and owner_id = '"..pc.get_player_id().."' and pos = '"..c.."';")                    if tonumber(check[1][1]) == 0 then                        mysql_query("UPDATE player.auktionshaus SET offen = '0' WHERE name = '"..name.."' and vnum = '"..vnum.."' and preis = '"..preis.."' and verkaufer = '"..verkaufer.."'")                        local pc_name_33 = pc.get_name()                        mysql_query("UPDATE player.auktionshaus SET verkauft = '"..pc_name_33.."' WHERE name = '"..name.."' and vnum = '"..vnum.."' and preis = '"..preis.."' and verkaufer = '"..verkaufer.."'")                        pc.change_money(-preis)                        mysql_query("UPDATE player.auktionshaus_benutzer SET gold = gold + "..preis.." WHERE name = '"..verkaufer.."'")                        mysql_query("update player.auktionshaus_benutzer set gold = gold - "..preis.." where name = '"..pc.get_name().."'")                        mysql_query("INSERT INTO player.item (owner_id,window,pos,count,vnum,attrtype0, attrvalue0, attrtype1, attrvalue1, attrtype2, attrvalue2, attrtype3, attrvalue3, attrtype4, attrvalue4, attrtype5, attrvalue5, attrtype6, attrvalue6, socket0, socket1, socket2) VALUES  ('"..pc.get_account_id().."', 'SAFEBOX', '"..c.."', '1', '"..vnum.."', '"..bonis.attrtype0[1].."', '"..bonis.attrvalue0[1].."', '"..bonis.attrtype1[1].."', '"..bonis.attrvalue1[1].."', '"..bonis.attrtype2[1].."', '"..bonis.attrvalue2[1].."', '"..bonis.attrtype3[1].."', '"..bonis.attrvalue3[1].."', '0', '0', '0', '0', '0', '0', '"..sockets.socket1[1].."', '"..sockets.socket2[1].."', '"..sockets.socket3[1].."');")                        say_title("Casa de Subastas:")                        say("Deine neue Waffe befindet sich nun in deinem Lager.")                    elseif tonumber(check[1][1]) > 0 then                        say_title("Casa de Subastas:")                        say_reward("Der ausgewählte Slot ist nichtmehr frei !")                        if select("Atrás") == 1 then                            auktions_haus.menu()                        end                    end                else                    say_title("Casa de Subastas:")                    say_reward("Usted no tiene suficiente dinero con usted para")                    say_reward("comprar el artículo")                    if select("Atrás") == 1 then                        auktions_haus.menu()                    end                end            elseif a == 2 then                auktions_haus.menu()            end        end
Enlace para comentar
Compartir en otros sitios

  • 2 weeks later...

esto no funciona 

tabelle = {}for i = 0, 39, 1 do	table.insert(tabelle, i)end

por q empiesa de 0,1,2...,39

la funcion 

s=select_table(tabelle)

solo funciona con index positivos epesando con el index 1, qiere desir q el primer index en esa funcion no se ve.

pruebalo mejor asi

if tonumber(auktions_haus.get_money(pc.get_name())) > tonumber(preis) then
Enlace para comentar
Compartir en otros sitios

  • Dilong locked this tema
Guest
Este tema está cerrado a otras respuestas.
  • Recientemente navegando por este tema   0 miembros

    • No hay usuarios registrados visitando esta página.
×
×
  • Crear nuevo...