Jump to content

Croqueta

Miembro
  • Contador contenido

    205
  • Ingreso

  • Última visita

  • Días ganados

    8

Todo lo publicado por Croqueta

  1. donde, es que lo use muchas veses son 6 numeros que se nesesita para el lotto, no se si te refieres a eso
  2. pero mi idea no esta mui correcta, el tipo qiere que venga el texto solo en unos jefes y no a todos, para eso es tu modo mejor, solo el string no lo nesesitas en la tabla, con mob_name(npc.get_race()) tambien tienes el nombre del bicho
  3. con el if-->'table' te dise que el npc que matastes es un jefe, que el vnum esta en la tabla por ejemplo, piensa que el perro es un jefe, y esta en la tabla tab={ [101]={101,"Perro"} } asi se ve si el perro es un jefe pero eso no se ve por que esta cargado en la tabla, eso funciona de esta forma. if tab[npc.get_race()]=='table' then npc.get_race() te da el vnum de el monstro que matastes, pero es tabien el index de la tabla tab sie el bicho es el perro entonses 101 print(tab[101])--tablay si el bicho no esta en el index entonses te da say(tab[npc.get_race()])--nil por que no esta escrito
  4. la loteria super corta quest a_noa_test begin state start begin when lotto_zeit.server_timer begin clear_server_timer("lotto_zeit") game.set_event_flag("lotto_block",1) notice_all("Die lotto zahlen werden in kürze angezeigt, das Lotto Event endet jetzt") server_timer("lotto_zeit_ende",5) end when lotto_zeit_ende.server_timer begin clear_server_timer("lotto_zeit_ende") notice_all("Die Lotto Zahlen Lauten") lottozahlen={} for i=1,6 do lottozahlen[i]=math.random(1,49) notice_all("Die Zahlen: "..lottozahlen[i]) end notice_all("geht zu Mirine, um euer Schein einzulösen") end when 20006.chat."Lottoschein einlösen" begin say_title(mob_name(npc.get_race())) say() say("Möchtest du dein lottoschein einlösen?") say("") if select("Ja","Nein")==2 then say("Dann ein anderes mal") return end for i=1,6 do say("Lotto zahlen: "..lottozahlen[i].." Deine zahlen "..pc.getqf("lotto_zahl"..i)) for _,v in next,lottozahlen do if v==pc.getqf("lotto_zahl"..i) then pc.setqf("lotto_richtig",pc.getqf("lotto_richtig")+1) end end end wait() if pc.getqf("lotto_richtig")==6 then say_title(mob_name(npc.get_race())) say() say("Du hast den jackpot geknackt") say("Du bekommst "..game.get_event_flag("jackpot").." yang") notice_all(pc.get_name().." Hat den jackpot in höhe von "..game.get_event_flag("jackpot").." yang geknackt") pc.change_money(game.get_event_flag("jackpot")) game.get_event_flag("jackpot",0) pc.setqf("lotto_richtig",0) else say_title(mob_name(npc.get_race())) say() say("Du hast leider "..pc.getqf("lotto_richtig").." von 6 Richtigen") pc.setqf("lotto_richtig",0) return end end when 20006.chat."Lotto Event Verwaltung" with pc.is_gm() and pc.get_gm_level()==5 begin say_title(mob_name(npc.get_race())) say() if game.get_event_flag("lotto") == 0 then say("Möchtest du das event Starten") if select("Starten","Abbrechen")==2 then return end game.set_event_flag("lotto",1) notice_all("Das Lotto Event wurde gestartet") server_timer("lotto_zeit",2) game.set_event_flag("lotto_block",0) for i=1,6 do game.get_event_flag("lotto_zahl1"..i,0) end else say("Möchtest du das event Beenden") if select("Beenden","Abbrechen")==2 then return end game.set_event_flag("lotto",0) game.set_event_flag("lotto_block",0) notice_all("Das Lotto Event wurde Beendet") for i=1,6 do game.set_event_flag("lotto_zahl1"..i,0) end clear_server_timer("lotto_zeit") clear_server_timer("lotto_zeit_ende") end end when 20006.chat."Lotto Schein kaufen" with pc.is_gm() begin if game.get_event_flag("lotto") == 0 then for i=1,6 do pc.setqf("lotto_zahl"..i,0) end end if game.get_event_flag("lotto_block")==1 then say_title(mob_name(npc.get_race())) say() say_red("Du kanst jetzt kein Schein kaufen") return end local costen= 100 say_title(mob_name(npc.get_race())) say() say("Möchtest du ein Lottoschein kaufen?") say() if select("Ja","Nein")==2 then say("Dann ein Anderes mal") return end say_title(mob_name(npc.get_race())) say() say("Ein lottoschein kostet "..costen.." yang") say("Lottoschein kaufen?") if select("Ja","Nein")==2 then say("Dann ein Anderes mal") return end local tabellelotto={} pc.setqf("lottocount",6) repeat say("Du musst noch "..pc.getqf("lottocount").." Zahlen eingeben") local eingabe=tonumber(input()) if eingabe then if eingabe >=1 and eingabe <= 49 then pc.setqf("lottocount",pc.getqf("lottocount")-1) tabellelotto[table.getn(tabellelotto)+1]=eingabe say_title(mob_name(npc.get_race())) say() say("Weiter?") if select("Weiter","Abbrechen")==2 then return end else say_title(mob_name(npc.get_race())) say() say_reward("Deine Zahl darf nicht kleiner als 0 sein oder größer[ENTER]als 49") say() end else say_title(mob_name(npc.get_race())) say() say_reward("Du hast keine Zahl eingegeben, Versuche es erneut") say() end if table.getn(tabellelotto)== 6 then say("Deine zahlen") for i=1,table.getn(tabellelotto) do say("Zahl:"..i,tabellelotto[i]) end say("Zahlen behalten?") say() local s=select("Ja","Nein","Abbrechen") if s==2 then tabellelotto={} pc.setqf("lottocount",6) elseif s==1 then say("Du hast die zahlen Aufgeschrieben") for i=1,6 do pc.setqf("lotto_zahl"..i,tabellelotto[i]) end pc.change_money(-costen) game.set_event_flag("jackpot",game.get_event_flag("jackpot")+costen) else return end end until pc.getqf("lottocount")==0 pc.delqf("lottocount") end end end
  5. tab=mysql_query("select vnum,locale_name from player.mob_proto where rank=5;") tabla={} table.foreachi(tab,function(index,value) tabla[value[1]]={value[1],value[2]} end) table.save(tabla,"ruta/asta/las/quests/jefe_tabla.lua") creo que el value[1] y 2 esta correcto, con eso ustedes tienen una tabla en un archivo con todo los jefes de mysql,despues no se nesesita usar mysql para usar en la quest se nesesita esto, --[[ tab se ve asi tab={ [vnum]={vnum,nombre} } pero en verdad no se nesesita el ombre en la tabla, solo lo ise para escplicar ]] when kill begin local tab=table.load(tabla,"ruta/asta/las/quests/jefe_tabla.lua") if tab[npc.get_race()]=="table" then say("mataste a "..mob_name(npc.get_race())) end endcreo q los jefes en la db son en rank 5 por eso lo use@yori para q aser una tabla con todos los jefes, si se puede aser todo automatico
  6. por que nadie usa mi funcion de las tablas? se puede aser mas rapido http://metin2zone.net/index.php?/topic/6594-memorizar-tablas-en-un-archivo-y-leer/
  7. no es nesesario, con este codigo no se nesesita cambiar siempre. if result == table.getn(nivel)+1 then return end Mira lo edite un poco quest mapas begin state start begin when 20011.chat."Ir a mapas" begin local coord_map = { {{nivel1},coord1x, coord1y }, {{nivel2},coord2x, coord2y }, {{nivel3},coord3x, coord3y }, {{nivel4},coord4x, coord4y }, {{nivel5},coord5x, coord5y }, {{nivel6},coord6x, coord6y }, {{nivel7},coord7x, coord7y }, {{nivel8},coord8x, coord8y } } say_title("Viajero:") say("Selecciona el mapa al que quieres ir") local result = select("map1", "map2", "map3", "map4", "map5","map6","map7","map8", "Cancelar") if result ==table.getn(coord_map)+1 then return end if pc.get_level() < coord_map[result][1][1] then chat("Lo siento, no tienes el nivel necesario para entrar a este mapa") return end pc.warp(coord_map[result][2],coord_map[result][3]) end end end
  8. mira keko, npc.get_race() te dise qual es el id de el montro. cuando usas when id.kill begin el monstro con el id no lo puedes usar en otras quest. un ejemplo..., when kill begin local metin = { [8001] = 1, [8002] = 1, [8003] = 2, [8004] = 2, [8005] = 3, [8006] = 3, [8007] = 3, [8008] = 4, [8009] = 4, [8010] = 5, [8011] = 5, [8012] = 6, [8013] = 6, [8014] = 8, [8024] = 10, [8025] = 11, [8026] = 12, [8027] = 13, } pc.give_item2("27003",metin[npc.get_race()]) chat("Has destruido un "..mob_name(npc.get_race())..", obtienes "..metin[npc.get_race()].." esferas de metin") endla quest se puede asi cortar y mejorar rapido
  9. el editor es par practicar lua, yo uso el editor cuando tengo que aser tablas grandes, por ejemplo
  10. Holla, para la gente que qiera un editor de lua http://luaforwindows.googlecode.com/files/LuaForWindows_v5.1.4-46.exe es un direkt link. el Programm se llama SciTe y es mi favorido para trabajar con tablas en lua, con ese editor ise por ejemplo el itemshop completo en lua despues, lo escribi en Metin.
  11. gracias, pero como tu lo isistes es tambien muy corto
  12. tenia un poco aburimiento ustedes tubieron todo el mismo error falso say(Yo te dare a elegir los siguientes items") correcto say("Yo te dare a elegir los siguientes items") v1 quest Nombre de la quest begin state start begin when ID del item a usar.use begin say_tittle ("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say("Yo te dare a elegir los siguientes items") local ta={"Nombre1","Nombre2","Nombre3","Cancelar"} local give_item={vnumitem1,vnumitem2,vnumitem3}-- se puede meter muchos items local main_set = select_table(ta) if main_set==table.getn(ta) then return end pc.give_item2(give_item[main_set], Cantidad) chat("Has recibido el item "..item_name(give_item[main_set]))--lee el item automatico item.remove() end end end v2 quest Nombre de la quest begin state start begin when ID del item a usar.use begin say_tittle("Nombre") say("Hola señor(a) ".. pc.get_name() .."") say("Con este ítem, usted puede ser millonario...") say("Si tu me das el Nombre del item") say("Yo te dare a elegir los siguientes items") local ta={"Nombre1","Nombre2","Nombre3","Cancelar"} local give_item= { {"item1","item1count"}, {"item2","item2count"}, {"item3","item3count"}, }-- se puede meter muchos items local main_set = select_table(ta) if main_set==table.getn(ta) then return end pc.give_item2(give_item[main_set][1], give_item[main_set][2]) chat("Has recibido el item "..item_name(give_item[main_set][1]))--lee el item automatico item.remove() end end end
  13. while pc.get_level() < nivel do local exple = pc.get_next_exp() pc.give_exp2(exple) end
  14. no es nesesario de abrir el notice con "" si tiene una funcion, no es falso como lo ases pero es mejor no escribir mas de lo que no nesesita
  15. lo ise un poco distinto... quest basic begin state start begin when login begin if pc.getqf("bas")==0 then local items= { { -- Guerrero {12269,1},{11299,1},{149,1},{189,1},{3139,1},{3169,1},{13069,1},{13089,1},{13109,1}, {13129,1},{14209,1},{16209,1},{17109,1},{15419,1},{15379,1},{50512,2},{71050,50},}, { -- Ninja {12399,1},{11499,1},{1109,1},{1139,1},{2149,1},{2179,1},{189,1},{13069,1},{13089,1}, {13109,1},{13129,1},{14209,1},{16209,1},{17169,1},{15419,1},{15379,1},{50512,2},{71050,50},}, { -- Sura {12539,1},{11699,1},{159,1},{249,1},{199,1},{189,1},{13069,1},{13089,1},{13109,1}, {13129,1},{14209,1},{16209,1},{17209,1},{15419,1},{15379,1},{50512,2},{71050,50},}, { -- Schaman {12679,1},{11899,1},{7149,1},{7159,1},{5109,1},{5129,1},{13069,1},{13089,1},{13109,1},{13129,1}, {14209,1},{16209,1},{17209,1},{15419,1},{15379,1},{50512,2},{71050,50},}, } table.foreachi(items[pc.get_job()+1],function(nr,item) pc.give_item2(item[1], item[2]) end) --while pc.get_level()< elnivel do -- pc.give_exp2(pc.get_next_exp()) --end pc.changemoney(500000000) --setskin(NOWINDOW) pc.setqf("bas",1) local job= {"Guererro","Ninja","Sura","Schaman"})[pc.get_job()+1] notice_all (pc.get_name().." es un nuevo "..job.." y comienza su aventura en Tuserver") say_title("Bienvenido") say() say_reward("Has Recibido Set de "..job.."!") chat("Bienvenido en el "..locale.empire_names[pc.get_empire()]) end end end end
  16. el uico mesaje que escribes es una duda?
  17. quest potionmorada begin state start begin when 27113.use or 27114.use or 27115.use or 27103.use or 27104.use or 27105.use begin local tabla={ [27113]={'effecto1',{{apply.ATT_GRADE_BONUS1,cantidad, tiempo},{apply.DEF_GRADE_BONUS, 50,10}}},--2 effectos [27114]={'effecto2',{{apply.ATT_GRADE_BONUS2,cantidad, tiempo}}}, --[[ se puede qitar si el item no tiene bonus {{apply.ATT_GRADE_BONUS,cantidad, tiempo}} esto ]] [27115]={'effecto3',{{apply.ATT_GRADE_BONUS3,cantidad, tiempo}}}, [27103]={'effecto4',{{apply.ATT_GRADE_BONUS4,cantidad, tiempo}}}, [27104]={'effecto5',{{apply.ATT_GRADE_BONUS5,cantidad, tiempo}}}, [27105]={'effecto6',{{apply.ATT_GRADE_BONUS6,cantidad, tiempo}}}, } cmdchat(tabla[item.get_vnum()][1]) if tabla[item.get_vnum()][2] == 'table' then for i=1,table.getn(tabla[item.get_vnum()][2]) do print(tabla[item.get_vnum()][2][i][1],tabla[item.get_vnum()][2][i][2],tabla[item.get_vnum()][2][i][3]) end end pc.remove_item(item.get_vnum(),1) end end end
  18. te va a dar un error por que el if no termina con un begin sino con el then falso if horse.get_grade() == pony_level_limit begin correcto if horse.get_grade() == pony_level_limit then
  19. edite un video, pero no se como ponerlo q se vea el player
  20. como el lo queria aser si la quest la escribi yo?
  21. n tu questlib y quest_function la funcion:
  22. Informacion: Hola a todos aca les traigo una quest de una item shop en el juego. realizada en su totalidad por mi Contiene: -Historial de Compras(log) -Historial De Donaciones (log) -Ingreso Como administrador (Agregar artículos / y quitarlos) -Tienda: Lecto de coins (Este archivo ha de ser creado manualmente) -Imagenes: Importante: Dentro de la descarga hay un archivo llamado vnumUtype.txt este se le modifica la extencion a .lua pathti="/usr/home/game/share/locale/germany/quest/test/" <<-- en esta ruta la tabla de la item shop y el vnumUtype.lua pathtc="/usr/home/game/share/locale/germany/quest/coins/" Se crea una nueva carpeta en las rutas anteriores, que depende de usted. Más importante aún es un punto que hay que generar la tabla en el juego, como un ejemplo de la matriz que me queda, por lo que puede orientarse a la misma. special thx on stein20 for help to translate imagen Quest quest ingameshop begin state start begin when 20006.chat."recharge ccoins" begin say_title(mob_name(npc.get_race())) spenden() end when 20006.chat."generate table" with pc.is_gm() begin --if pc.get_gm_level()!=5 then return end say("really generate table?") if select("Yes","No")==2 then return end local ingameshop={ --[[ if you use this first time, push Yes ]] {--weapons {item1,item2},--ids {coins1,cois2}--coins }, {--armor {item1,item2},--ids {coins1,coins2}--coins }, {--special tems {item1,item2},--ids {coins1,item2}--coins } } table.save(ingameshop,pathti.."testtabelle.lua") end when 20006.chat."ItemShop" begin local name_items={} local ingameshop=table.load(pathti.."testtabelle.lua") say_title(mob_name(npc.get_race())) say() say("Choose your category") local auswahl=select3(itemshopk) for i=1,table.getn(ingameshop[auswahl][1]) do table.insert(name_items,tostring(item_name(ingameshop[auswahl][1][i]))) end say_title(mob_name(npc.get_race())) say() say("select the item ") say() local itemshop_i = select3(name_items) if itemshop_i == table.getn(name_items) then return end say_title(string.format("Coins :%d ", get_coins())) say() say("Would you really buy the item?") say() say_gold("it cost "..ingameshop[auswahl][2][itemshop_i].." Coins") say_item_vnum(ingameshop[auswahl][1][itemshop_i]) say("") if select("Yes","No") == 2 then return end if get_coins()<ingameshop[auswahl][2][itemshop_i] then say("not enough coins ") return end say_green("you have buy "..item_name(ingameshop[auswahl][1][itemshop_i]).." for- ") say_green(ingameshop[auswahl][2][itemshop_i].." Coins") say_item_vnum(ingameshop[auswahl][1][itemshop_i]) coins_write((get_coins()-ingameshop[auswahl][2][itemshop_i])) pc.give_item2(ingameshop[auswahl][1][itemshop_i]) write_log(ingameshop[auswahl][1][itemshop_i],ingameshop[auswahl][2][itemshop_i]) end when 20006.chat."Manage Itemshop" with pc.is_gm() begin local tabelle=table.load(pathti.."vnumUtype.lua") local i_shop=table.load(pathti.."testtabelle.lua") say_title(mob_name(npc.get_race())) say() say("Hello "..string.format("%s",pc.get_name())) say("What would you like do?") local s=select("add new items","removing Items","Nothig") if s==3 then return end if s==1 then say_title(mob_name(npc.get_race())) say() say("Choose a category") say("where you want to add the item") local auswahl=select3(itemshopk) say_title(mob_name(npc.get_race())) say() say(itemshopk[auswahl]..": insert into this category?") if select("Yes","No") == 2 then return end say_title(mob_name(npc.get_race())) say() say("Which item you wish to add?") say("Enter the vnum") local vnum= tonumber(input()) if vnum ==nil then say("You have to enter something") return end if auswahl== 1 then if tabelle[vnum][1] != 1 then say("This is not a weapon") return end elseif auswahl == 2 then if tabelle[vnum][1] != 2 then say("This is not a amor") return end elseif auswahl == 3 then if tabelle[vnum][1] == 1 or tabelle[vnum][1]==2 then say("only for special items") return end end say_title(mob_name(npc.get_race())) say() say("Give the price of that item") say() local money= tonumber(input()) if money==nil then say("You have to enter something") return end say_title(mob_name(npc.get_race())) say() say("keeping?") say() say("Item: "..item_name(vnum).." Price: "..money) say_item_vnum(vnum) if select("Yes","No") == 2 then return end i_shop[auswahl][1][table.getn(i_shop[auswahl][1])+1]=vnum i_shop[auswahl][2][table.getn(i_shop[auswahl][2])+1]=money --table.insert(i_shop[auswahl][1],vnum) --table.insert(i_shop[auswahl][2],money) table.save(i_shop,pathti.."testtabelle.lua") say("you have add "..item_name(vnum)) elseif s==2 then local auswahl_items={} say("Choose the item that you wish to remove") say() local a=select3(itemshopk) for i=1,table.getn(i_shop[a][1]) do table.insert(auswahl_items,tostring(item_name(i_shop[a][1][i]))) end say("Choose the item that you wish to remove") say() local itemshop_r = select3(auswahl_items) if itemshop_r==table.getn(auswahl_items) then return end table.remove(i_shop[a][1],i_shop[a][1][itemshop_r]) table.remove(i_shop[a][2],i_shop[a][2][itemshop_r]) table.save(i_shop,pathti.."testtabelle.lua") --[[for i= 1,table.getn(ingameshop[auswahl][1]) do say(i_shop[auswahl][1][i].."\t"..i_shop[auswahl][2][i]) end]] end end end end questlib.lua pathti="/usr/home/game/share/locale/germany/quest/test/"--ruta de la tabla pathtc="/usr/home/game/share/locale/germany/quest/coins/"--ruta de los coins itemshopk={"Waffe","Rüstungen","Sonstiges"} function write_log(vnum,coins) local i_name=item_name(vnum) datei = io.open(pathti.."shop_log.lua", "a+") if datei==nil then say("Error loading the file") return end datei:write("PLayerID:\t"..pc.get_player_id().."\tPlayerName:\t"..pc.get_name().."\tItemName:\t"..i_name.."\tDate/Time:\t"..os.date("%c").."\tCoins:\t"..coins.."\n") datei:close() end function get_coins() local file = io.open(pathtc..""..pc.get_player_id()..".txt",'r') if file==nil then return 0 end for line in file:lines() do return line end file:close() end function coins_write(coins) file = io.open(pathtc..""..pc.get_player_id()..".txt","w") file:write(coins) file:close() end function spenden() say() say("How much you want to donate?") say_reward("Online Paysafecard will not be accepted") say() s = select("10","25","50","100","cancel") wert = { 10 , 25 , 50 , 100} if s==table.getn(wert)+1 then return end say_title(mob_name(20006)) say() say("Now give the PSC numbers") say() eing2= input() if string.len(eing2)~=16 then say("Your input has no 16 numbers") return end if string.sub(eing2,0,1)=='1' or string.sub(eing2,0,2)=='00' then say("Online Paysafecard will not be accepted") return end say_title(mob_name(20006)) say() say('The PSC is protected with a password?') if select("Yes","No")==2 then eing3=0 else say("Enter the password") eing3 = input() if eing3=='' then say("You have to enter something") return end end say() say("Your input:") say("cash: "..wert[s]) say("PSC: "..eing2) if eing3 == 0 then say("PW: /") else say("PW: "..eing3) end say("Keeping?") say() if select("Yes","No") == 2 then return end say("your Coins will be credited to you after the control") file = io.open(pathti.."psc_log.lua","a+") --file:write("PlayerName:\t"..pc.get_name().."\tCash:\t"..wert[s].."\tPSC:\t"..eing2.."\tPW:\t"..eing3.."\tDate/Time:\t"..os.date("%c").."\n") file:write("ID:\t"..pc.get_player_id().."PlayerName:\t"..pc.get_name().."\tCash:\t"..wert[s].."\tPSC:\t"..eing2.."\tPW:\t"..eing3.."\tDate:\t"..os.date("%c").."\t\n") file:close() end function select3(...) arg.n = nil local tp,max = arg,5 if type(tp[1]) == 'number' then max = tp[1] if type(tp[2]) == 'table' then tp = tp[2] else table.remove(tp,1) end elseif type(tp[1]) == 'table' then if type(tp[1][1]) == 'number' then max = tp[1][1] table.remove(tp[1],1) tp = tp[1] end tp = tp[1] end local str = '{' local tablen,act,incit = table.getn(tp),0,0 table.foreach(tp,function(i,l) act = act + 1 if act == 1 then str = str .. '{'..string.format('%q',l) elseif act == max+1 and tablen > act+incit then if tablen ~= act+incit+1 then str = str..'},{'..string.format('%q',l) else str=str..','..string.format('%q',l) end incit = incit + max act = 1 else str=str..','..string.format('%q',l) end end) local px = loadstring('return '..str ..'}}')() local function copy_tab(t) local p= {} for i = 1,table.getn(t) do p[i] = t[i] end return p end local pe = {} for i = 1,table.getn(px) do pe [i] = copy_tab(px[i]) end local function init(i,ip) pe[i] = copy_tab(px[i]) local next,back,exit = 0,0,0 if i < table.getn(pe) and table.getn(pe) ~=1 then table.insert(pe[i],table.getn(pe[i])+1,'Para alante Pagina '..(i+1)); next = table.getn(pe[i]) end if i > 1 then table.insert(pe[i],table.getn(pe[i])+1,'Para atraz pagina '..(i-1)); back = table.getn(pe[i]) end table.insert(pe[i],table.getn(pe[i])+1,'Cerrar'); exit = table.getn(pe[i]) if table.getn(pe) > 1 then say('pagina '..i..' de '..table.getn(pe)) end local e = select_table(pe[i]) if e == next then return init(i+1,ip+max) elseif e == back then return init(i-1,ip-max) elseif e == exit then return -1 else return e+ip,pe[i][e] end end return init(1,0) or -1 end local function exportstring( s ) return string.format("%q", s) end function table.save( tbl,filename ) local charS,charE = " ","\n" local file,err = io.open( filename, "wb" ) if err then return err end local tables,lookup = { tbl },{ [tbl] = 1 } file:write( "return {"..charE ) for idx,t in ipairs( tables ) do file:write( "-- Table: {"..idx.."}"..charE ) file:write( "{"..charE ) local thandled = {} for i,v in ipairs( t ) do thandled[i] = true local stype = type( v ) if stype == "table" then if not lookup[v] then table.insert( tables, v ) lookup[v] = table.getn(tables) end file:write( charS.."{"..lookup[v].."},"..charE ) elseif stype == "string" then file:write( charS..exportstring( v )..","..charE ) elseif stype == "number" then file:write( charS..tostring( v )..","..charE ) end end for i,v in pairs( t ) do if (not thandled[i]) then local str = "" local stype = type( i ) if stype == "table" then if not lookup[i] then table.insert( tables,i ) lookup[i] = table.getn(tables) end str = charS.."[{"..lookup[i].."}]=" elseif stype == "string" then str = charS.."["..exportstring( i ).."]=" elseif stype == "number" then str = charS.."["..tostring( i ).."]=" end if str ~= "" then stype = type( v ) if stype == "table" then if not lookup[v] then table.insert( tables,v ) lookup[v] = table.getn(tables) end file:write( str.."{"..lookup[v].."},"..charE ) elseif stype == "string" then file:write( str..exportstring( v )..","..charE ) elseif stype == "number" then file:write( str..tostring( v )..","..charE ) end end end end file:write( "},"..charE ) end file:write( "}" ) file:close() end function table.load( sfile ) local ftables,err = loadfile( sfile ) if err then return _,err end local tables = ftables() for idx = 1,table.getn(tables) do local tolinki = {} for i,v in pairs( tables[idx] ) do if type( v ) == "table" then tables[idx][i] = tables[v[1]] end if type( i ) == "table" and tables[i[1]] then table.insert( tolinki,{ i,tables[i[1]] } ) end end for _,v in ipairs( tolinki ) do tables[idx][v[2]],tables[idx][v[1]] = tables[idx][v[1]],nil end end return tables[1] end quest_function write_log get_coins coins_write spenden select3 table.save table.load http-~~-//www.youtube.com/watch?v=5avAKriuCTg vnumUtype.txt
  23. quest teleportar begin state start begin when letter begin send_letter("Teleportar") end when info or button begin local warp={"Ciudad 1 - Jinno", "Ciudad 2 - Jinno", "Ciudad 1 - Shinsoo", "Ciudad 2 - Shinsoo", "Ciudad 1 - Chunjo", "Ciudad 2 - Chunjo","otro mapa"} local warps= select2(warp) local tele={ {969600, 278400},--Ciudad 1 - Jinno {873100, 242600},--Ciudad 2 - Jinno {469300, 964200},--Ciudad 1 - Shinsoo {360800, 877600},--Ciudad 2 - Shinsoo {55700, 157900},--Ciudad 1 - Chunjo {138500, 234900},--Ciudad 2 - Chunjo {otromX,otromY} } pc.warp(tele[warps][1], tele[warps][2]) end end end asi tu puedes poner muchoas partes en la tabla, hasta tiene un boton para atras.Pone esta funcion en tu questlib y quest_function la funcion: function select3(...) arg.n = nil local tp,max = arg,5 if type(tp[1]) == 'number' then max = tp[1] if type(tp[2]) == 'table' then tp = tp[2] else table.remove(tp,1) end elseif type(tp[1]) == 'table' then if type(tp[1][1]) == 'number' then max = tp[1][1] table.remove(tp[1],1) tp = tp[1] end tp = tp[1] end local str = '{' local tablen,act,incit = table.getn(tp),0,0 table.foreach(tp,function(i,l) act = act + 1 if act == 1 then str = str .. '{'..string.format('%q',l) elseif act == max+1 and tablen > act+incit then if tablen ~= act+incit+1 then str = str..'},{'..string.format('%q',l) else str=str..','..string.format('%q',l) end incit = incit + max act = 1 else str=str..','..string.format('%q',l) end end) local px = loadstring('return '..str ..'}}')() local function copy_tab(t) local p= {} for i = 1,table.getn(t) do p[i] = t[i] end return p end local pe = {} for i = 1,table.getn(px) do pe [i] = copy_tab(px[i]) end local function init(i,ip) pe[i] = copy_tab(px[i]) local next,back,exit = 0,0,0 if i < table.getn(pe) and table.getn(pe) ~=1 then table.insert(pe[i],table.getn(pe[i])+1,'Para alante Pagina '..(i+1)); next = table.getn(pe[i]) end if i > 1 then table.insert(pe[i],table.getn(pe[i])+1,'Para atraz pagina '..(i-1)); back = table.getn(pe[i]) end table.insert(pe[i],table.getn(pe[i])+1,'Cerrar'); exit = table.getn(pe[i]) if table.getn(pe) > 1 then say('pagina '..i..' de '..table.getn(pe)) end local e = select_table(pe[i]) if e == next then return init(i+1,ip+max) elseif e == back then return init(i-1,ip-max) elseif e == exit then return -1 else return e+ip,pe[i][e] end end return init(1,0) or -1 end
  24. xD local prueba = mysql_query("select real_name from account.account where id=(select account_id from player.player where name='"..pc.get_name().."');") say_light_blue("En la casilla real_name tienes puesto: "..prueba.real_name[1]..".")
×
×
  • Crear nuevo...