Register for your free account! | Forgot your password?

You last visited: Today at 21:50

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[R]Ingame ItemShop System

Discussion on [R]Ingame ItemShop System within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2013
Posts: 154
Received Thanks: 507
Cool [R]Ingame ItemShop System





Hi Guys

In-game itemshop sytems is share..

I hope you like it.

#Edit

I tested and %100 work.

I don't know about MySQL 5.5 version.





Quest:

PHP Code:
----------------------------------------------------------------------
--- 
Ingame ItemShop
--- Copyright © HaveBeen™  2013-2014. All rights reserved.
----------------------------------------------------------------------
quest ingameshop begin
    state start begin
        
function add_newcategory(name)
            if(
name == "" or tostring(name) == nilthen
                
return -1
            end
            mysql_query
("insert into player.ingameshop_category values ('"..name.."') ")
        
end
        
function load_category()
            
local a mysql_query("select * from player.ingameshop_category")
            
local list = {}
            
table.foreachi(a,
                function(
n,p)
                    list[
n] = a.category_name[n]
            
end)
            if(
table.getn(a) == 0then
                
return -1
            end
            
return list
        
end
        
function load_items(categoryname)
            
local a mysql_query("select* from player.ingameshop where category_name = '"..categoryname.."'")
            if(
table.getn(a) == 0then
                
return -1
            end
            local vnums
,names,counts,eps = {},{},{},{}
            
table.foreachi(a,
                function(
n,p)
                    
vnums[n],names[n],counts[n],eps[n] = a.category_itemvnum[n],item_name(a.category_itemvnum[n]),a.category_itemcount[n],a.category_ep[n]
            
end)
            return 
vnums,names,counts,eps
        end
        
function check_name(name)
            if(
name == "" or tostring(name) == nilthen
                
return 0
            end
            local a 
mysql_query("select * from player.ingameshop_category where category_name = '"..name.."'")
            if(
table.getn(a) == 1then
                
return -1
            end
        end
        
function buy(vnum,count,ep)
            
mysql_query("update player.ingameshop_player set ep = ep-'"..ep.."' where id = '"..pc.get_player_id().."'")
            
pc.give_item2(vnum,count)
        
end
        
function totalep()
            
local a mysql_query("select * from player.ingameshop_player where id = '"..pc.get_player_id().."'")
            return 
a.ep[1]
        
end
        
function add_newitem(categoryname,vnum,count,ep)
            
mysql_query("insert into player.ingameshop values ('"..categoryname.."','"..vnum.."','"..count.."','"..ep.."') ")
        
end
        when 20354.chat
."Administration Panel" with pc.is_gm() begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            
say("Welcome to the administration panel, Mr."..pc.name)
            
say("What would you like to do?")
            
say("")
            
local s select("Add a new category","Add new object","Dragon Marks Upload","Close")
            if(
== 1then
                say_title
("Add a new category:")
                
say("")
                ---
                
say("Please write the name of the new category.")
                
say("")
                
local name tostring(input())
                
local check ingameshop.check_name(name)
                if(
name == "" or name == nilthen
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("You have to be a category name.")
                    
say_reward("")
                    return;
                elseif(
check == -1then
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("One such category already exists.")
                    
say_reward("")
                    return;
                
end
                say_title
("Add a new category:")
                
say("")
                ---
                
ingameshop.add_newcategory(name)
                
say_reward("A new category was added successfully.")
                
say_reward("Thanks!")
                
say_reward("")
            elseif(
== 2then
                say_title
("Add new object:")
                
say("")
                ---
                
say("Select the category you want to attach")
                
say("the new object.")
                
say("")
                
local tables ingameshop.load_category()
                
table.insert(tables,"Close")
                
local select select_table(tables)
                if(
table.getn(tables) == selectthen
                    
return;
                
end
                say_title
(tables[select]..":")
                
say("")
                ---
                
say("Please enter vnum.")
                
say("")
                
local vnum tonumber(input())
                if(
vnum == "" or vnum == nilthen
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("You must enter a vnum.")
                    
say_reward("")
                    return;
                
end
                say_title
(tables[select]..":")
                
say("")
                ---
                
say("Please enter the number of the object.")
                
say("")
                
local count tonumber(input())
                if(
count == "" or count == nilthen
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("You have to enter the number of object.")
                    
say_reward("")
                    return;
                
end
                say_title
(tables[select]..":")
                
say("")
                --
                
say("How much will be sold? ")
                
say("EP(Dragon Marks)")
                
local ep tonumber(input())
                if(
ep == "" or ep == nilthen
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("You have to enter the number of the object will be sold in ep.")
                    return;
                
end
                say_title
("Add new object:")
                
say("")
                ---
                
ingameshop.add_newitem(tostring(tables[select]),vnum,count,ep)
                
say_reward("Object Name : "..item_name(vnum))
                
say_reward("Number of object : "..count)
                
say_reward("The amount of EP Sold: "..ep)
                
say("")
                
say_reward("Object successfully added.")
            elseif(
== 3then
                say_title
("EP(Dragon Marks) Upload:")
                
say("")
                ---
                
say("Please enter name")
                
say("")
                
local sname tostring(input())
                
local find find_pc_by_name(sname)
                if(
sname == "" or sname == nilthen
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("I understand but i can't anything")
                    
say_reward("without a name.")
                    return;
                elseif(
sname == pc.get_name()) then
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("Why are you writing your own name?")
                    return;
                elseif(
find == 0then
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("There's no like that or not online.")
                    
say_reward("")
                    return ;
                
end
                say_title
("EP(Dragon Marks) Upload:")
                
say("")
                ---
                
say("Please enter a dragon mark?")
                
say("")
                
local ep tonumber(input())
                if(
ep == "" or ep == nilthen
                    say_title
("Error:")
                    
say("")
                    ---
                    
say_reward("Don't you know?")
                    return;
                
end
                local select 
pc.select(find)
                
mysql_query("update ingameshop_player set ep = ep+'"..ep.."' where id = '"..pc.get_player_id().."'")
                
local name pc.name
                pc
.select(select)
                
say_reward("Uploaded on dragon marks. Thanks.")
            
end
        end
        when 20354.chat
."In-game itemshop system" begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            if(
pc.getf("ingameshop","ep") == 0then
                pc
.setf("ingameshop","ep",1)
                
mysql_query("insert into player.ingameshop_player values ('"..pc.get_player_id().."','0')")
            
end
            say
("Hello "..pc.name.." welcome to in-game")
            
say("itemshop system.")
            
say("")
            
say_reward("Current EP(Dragon Marks): "..ingameshop.totalep())
            
say_reward("What would you like to do?")
            
say("")
            
local s select("Enter the object store","Close")
            if(
== 1then
                say_title
("Enter the object store")
                
say("")
                ---
                
say("Please select a category")
                
say("")
                
local tables ingameshop.load_category()
                
table.insert(tables,"Close")
                
local select select_table(tables)
                if(
table.getn(tables) == selectthen
                    
return;
                
end
                say_title
(tables[select])
                
say("")
                ---
                
local vnums,names,counts,eps ingameshop.load_items(tostring(tables[select]))
                
say("Sort existing objects.")
                
say("")
                
table.insert(names,"No")
                
local items select_table(names)
                if(
table.getn(names) == itemsthen
                    
return;
                
end
                say_title
(names[items].." features:")
                
say("")
                ---
                
say("Object Name: "..names[items])
                
say("Number of object: "..counts[items])
                
say("Quantity Required EP: "..eps[items])
                
say("")
                
say_item_vnum(vnums[items])
                
say("")
                
wait()
                
say_title("Decision:")
                
say("")
                ---
                
say_reward("Do you want to buy?")
                
local option = {"Yes","No"}
                
local confirms select_table(option)
                if(
confirms == 2then
                    
return
                
end
                
if(ingameshop.totalep() < eps[items]) then
                    say_title
("Error:")
                    
say("")
                    --
                    
say_reward(string.format("This object needs to receive %d EP",eps[items]))
                    
say_reward("")
                    return;
                
end
                say_title
(names[items].." received")
                
say("")
                ---
                
say(names[items].." bought the object")
                
say("it is no longer the inventory!")
                
ingameshop.buy(vnums[items],counts[items],eps[items])                
            
end
        end
    end
end 
Player database:

PHP Code:
SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
-- 
Table structure for `ingameshop`
-- ----------------------------
DROP TABLE IF EXISTS `ingameshop`;
CREATE TABLE `ingameshop` (
  `
category_namevarchar(255character set latin1 NOT NULL,
  `
category_itemvnumint(255NOT NULL,
  `
category_itemcountint(255NOT NULL,
  `
category_epint(255NOT NULL
ENGINE=MyISAM DEFAULT CHARSET=latin5;

-- ----------------------------
-- 
Records of ingameshop
-- ----------------------------

-- ----------------------------
-- 
Table structure for `ingameshop_category`
-- ----------------------------
DROP TABLE IF EXISTS `ingameshop_category`;
CREATE TABLE `ingameshop_category` (
  `
category_namevarchar(255NOT NULL,
  
PRIMARY KEY  (`category_name`)
ENGINE=MyISAM DEFAULT CHARSET=latin5;

-- ----------------------------
-- 
Records of ingameshop_category
-- ----------------------------

-- ----------------------------
-- 
Table structure for `ingameshop_player`
-- ----------------------------
DROP TABLE IF EXISTS `ingameshop_player`;
CREATE TABLE `ingameshop_player` (
  `
idint(16NOT NULL,
  `
epint(255NOT NULL
ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- ----------------------------
-- 
Records of ingameshop_player
-- ---------------------------- 
[TR]Turkish

PHP Code:
----------------------------------------------------------------------
--- 
Ingame ItemShop
--- Copyright © HaveBeen™  2013-2014. All rights reserved.
--- [
TR]Turkish
----------------------------------------------------------------------
quest ingameshop begin
    state start begin
        
function add_newcategory(name)
            if(
name == "" or tostring(name) == nilthen
                
return -1
            end
            mysql_query
("insert into player.ingameshop_category values ('"..name.."') ")
        
end
        
function load_category()
            
local a mysql_query("select * from player.ingameshop_category")
            
local list = {}
            
table.foreachi(a,
                function(
n,p)
                    list[
n] = a.category_name[n]
            
end)
            if(
table.getn(a) == 0then
                
return -1
            end
            
return list
        
end
        
function load_items(categoryname)
            
local a mysql_query("select* from player.ingameshop where category_name = '"..categoryname.."'")
            if(
table.getn(a) == 0then
                
return -1
            end
            local vnums
,names,counts,eps = {},{},{},{}
            
table.foreachi(a,
                function(
n,p)
                    
vnums[n],names[n],counts[n],eps[n] = a.category_itemvnum[n],item_name(a.category_itemvnum[n]),a.category_itemcount[n],a.category_ep[n]
            
end)
            return 
vnums,names,counts,eps
        end
        
function check_name(name)
            if(
name == "" or tostring(name) == nilthen
                
return 0
            end
            local a 
mysql_query("select * from player.ingameshop_category where category_name = '"..name.."'")
            if(
table.getn(a) == 1then
                
return -1
            end
        end
        
function buy(vnum,count,ep)
            
mysql_query("update player.ingameshop_player set ep = ep-'"..ep.."' where id = '"..pc.get_player_id().."'")
            
pc.give_item2(vnum,count)
        
end
        
function totalep()
            
local a mysql_query("select * from player.ingameshop_player where id = '"..pc.get_player_id().."'")
            return 
a.ep[1]
        
end
        
function add_newitem(categoryname,vnum,count,ep)
            
mysql_query("insert into player.ingameshop values ('"..categoryname.."','"..vnum.."','"..count.."','"..ep.."') ")
        
end
        when 20354.chat
."Yönetim Paneli" with pc.is_gm() begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            
say("Yönetim Paneline hoşgeldiniz, Bay/Bayan."..pc.name)
            
say("Ne yapmak istiyorsunuz?")
            
say("")
            
local s select("Yeni bir kategori ekle","Yeni obje ekle","Ejderha Markası yükle","Kapat")
            if(
== 1then
                say_title
("Yeni bir kategori ekle:")
                
say("")
                ---
                
say("Lütfen yeni kategorinin ismini yazın.")
                
say("")
                
local name tostring(input())
                
local check ingameshop.check_name(name)
                if(
name == "" or name == nilthen
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Bir kategori adı gerekiyor.")
                    
say_reward("")
                    return;
                elseif(
check == -1then
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Zaten böyle bir kategori var.")
                    
say_reward("")
                    return;
                
end
                say_title
("Yeni bir kategori ekle:")
                
say("")
                ---
                
ingameshop.add_newcategory(name)
                
say_reward("Yeni bir kategori ekleme başarılı.")
                
say_reward("Teşekkürler!")
                
say_reward("")
            elseif(
== 2then
                say_title
("Yeni obje ekle:")
                
say("")
                ---
                
say("Ekliyeceğiniz obje için bir kategori")
                
say("seçin.")
                
say("")
                
local tables ingameshop.load_category()
                
table.insert(tables,"Kapat")
                
local select select_table(tables)
                if(
table.getn(tables) == selectthen
                    
return;
                
end
                say_title
(tables[select]..":")
                
say("")
                ---
                
say("Lütfen vnum'u giriniz.")
                
say("")
                
local vnum tonumber(input())
                if(
vnum == "" or vnum == nilthen
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Bir vnum girmek zorundasın.")
                    
say_reward("")
                    return;
                
end
                say_title
(tables[select]..":")
                
say("")
                ---
                
say("Lütfen obje adedini yazın.")
                
say("")
                
local count tonumber(input())
                if(
count == "" or count == nilthen
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Bir obje adedi girmelisin.")
                    
say_reward("")
                    return;
                
end
                say_title
(tables[select]..":")
                
say("")
                --
                
say("Ne kadara satılacak? ")
                
say("EP(Ejderha Markası)")
                
local ep tonumber(input())
                if(
ep == "" or ep == nilthen
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Objeyi kategoriye koyabilmek için EP'i belirtmek zorundasın.")
                    return;
                
end
                say_title
("Yeni obje ekle:")
                
say("")
                ---
                
ingameshop.add_newitem(tostring(tables[select]),vnum,count,ep)
                
say_reward("Obje adı : "..item_name(vnum))
                
say_reward("Obje adedi : "..count)
                
say_reward("Satılacak EP miktarı : "..ep)
                
say("")
                
say_reward("Obje başarıyla eklendi.")
            elseif(
== 3then
                say_title
("EP(Ejderha Markası) Yükle:")
                
say("")
                ---
                
say("Isim giriniz")
                
say("")
                
local sname tostring(input())
                
local find find_pc_by_name(sname)
                if(
sname == "" or sname == nilthen
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Anlıyorum fakat bir isim olmadan")
                    
say_reward("hiçbir şey yapamam.")
                    return;
                elseif(
sname == pc.get_name()) then
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Neden kendi ismini yazıyorsun?")
                    return;
                elseif(
find == 0then
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Böyle birisi yok ya da çevrimdışı.")
                    
say_reward("")
                    return ;
                
end
                say_title
("EP(Ejderha Markası) Yükle:")
                
say("")
                ---
                
say("Miktar giriniz")
                
say("")
                
local ep tonumber(input())
                if(
ep == "" or ep == nilthen
                    say_title
("Hata:")
                    
say("")
                    ---
                    
say_reward("Bilmiyor musun?")
                    return;
                
end
                local select 
pc.select(find)
                
mysql_query("update ingameshop_player set ep = ep+'"..ep.."' where id = '"..pc.get_player_id().."'")
                
local name pc.name
                pc
.select(select)
                
say_reward("Ejderha markası yüklendi. Teşekkürler.")
            
end
        end
        when 20354.chat
."In-game itemshop system" begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            if(
pc.getf("ingameshop","ep") == 0then
                pc
.setf("ingameshop","ep",1)
                
mysql_query("insert into player.ingameshop_player values ('"..pc.get_player_id().."','0')")
            
end
            say
("Merhaba "..pc.name.." oyun-içi")
            
say("alışveriş sistemine hoşgeldin.")
            
say("")
            
say_reward("Mevcut EP(Ejderha Markası): "..ingameshop.totalep())
            
say_reward("Ne yapmak istiyorsun?")
            
say("")
            
local s select("Nesne markete giriş yap","Kapat")
            if(
== 1then
                say_title
("Nesne markete giriş yap")
                
say("")
                ---
                
say("Lütfen bir kategori seçin.")
                
say("")
                
local tables ingameshop.load_category()
                
table.insert(tables,"Kapat")
                
local select select_table(tables)
                if(
table.getn(tables) == selectthen
                    
return;
                
end
                say_title
(tables[select])
                
say("")
                ---
                
local vnums,names,counts,eps ingameshop.load_items(tostring(tables[select]))
                
say("Mevcut nesneler sıralandı.")
                
say("")
                
table.insert(names,"Hayır")
                
local items select_table(names)
                if(
table.getn(names) == itemsthen
                    
return;
                
end
                say_title
(names[items].." özellikleri:")
                
say("")
                ---
                
say("Obje adı: "..names[items])
                
say("Obje adedi: "..counts[items])
                
say("Gerekli EP Miktarı: "..eps[items])
                
say("")
                
say_item_vnum(vnums[items])
                
say("")
                
wait()
                
say_title("Karar:")
                
say("")
                ---
                
say_reward("Satın almak istiyor musun?")
                
local option = {"Evet","Hayır"}
                
local confirms select_table(option)
                if(
confirms == 2then
                    
return
                
end
                
if(ingameshop.totalep() < eps[items]) then
                    say_title
("Hata:")
                    
say("")
                    --
                    
say_reward(string.format("Bu obje satın almak için %d ep gerekli.",eps[items]))
                    
say_reward("")
                    return;
                
end
                say_title
(names[items].." aldın.")
                
say("")
                ---
                
say(names[items].." objeyi satın aldın.")
                
say("O artık envaterinde!")
                
ingameshop.buy(vnums[items],counts[items],eps[items])                
            
end
        end
    end
end 
[DE]Germany

PHP Code:
----------------------------------------------------------------------
--- 
Ingame ItemShop
--- Copyright © HaveBeen™  2013-2014. All rights reserved.
--- [
DE]Germany
----------------------------------------------------------------------
quest ingameshop begin
    state start begin
        
function add_newcategory(name)
            if(
name == "" or tostring(name) == nilthen
                
return -1
            end
            mysql_query
("insert into player.ingameshop_category values ('"..name.."') ")
        
end
        
function load_category()
            
local a mysql_query("select * from player.ingameshop_category")
            
local list = {}
            
table.foreachi(a,
                function(
n,p)
                    list[
n] = a.category_name[n]
            
end)
            if(
table.getn(a) == 0then
                
return -1
            end
            
return list
        
end
        
function load_items(categoryname)
            
local a mysql_query("select* from player.ingameshop where category_name = '"..categoryname.."'")
            if(
table.getn(a) == 0then
                
return -1
            end
            local vnums
,names,counts,eps = {},{},{},{}
            
table.foreachi(a,
                function(
n,p)
                    
vnums[n],names[n],counts[n],eps[n] = a.category_itemvnum[n],item_name(a.category_itemvnum[n]),a.category_itemcount[n],a.category_ep[n]
            
end)
            return 
vnums,names,counts,eps
        end
        
function check_name(name)
            if(
name == "" or tostring(name) == nilthen
                
return 0
            end
            local a 
mysql_query("select * from player.ingameshop_category where category_name = '"..name.."'")
            if(
table.getn(a) == 1then
                
return -1
            end
        end
        
function buy(vnum,count,ep)
            
mysql_query("update player.ingameshop_player set ep = ep-'"..ep.."' where id = '"..pc.get_player_id().."'")
            
pc.give_item2(vnum,count)
        
end
        
function totalep()
            
local a mysql_query("select * from player.ingameshop_player where id = '"..pc.get_player_id().."'")
            return 
a.ep[1]
        
end
        
function add_newitem(categoryname,vnum,count,ep)
            
mysql_query("insert into player.ingameshop values ('"..categoryname.."','"..vnum.."','"..count.."','"..ep.."') ")
        
end
        when 20354.chat
."Administrations-Bereich" with pc.is_gm() begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            
say("Willkommen auf der Administrations-Bereich, Herr."..pc.name)
            
say("Was möchten Sie tun??")
            
say("")
            
local s select("Neue Kategorie hinzufügen","Neues Objekt hinzufügen","Drache Marks hochladen","Schließen")
            if(
== 1then
                say_title
("Neue Kategorie hinzufügen:")
                
say("")
                ---
                
say("Bitte schreiben Sie den Namen der neuen Kategorie.")
                
say("")
                
local name tostring(input())
                
local check ingameshop.check_name(name)
                if(
name == "" or name == nilthen
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Du musst eine Kategorie Name sein.")
                    
say_reward("")
                    return;
                elseif(
check == -1then
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Eine solche Kategorie ist bereits vorhanden.")
                    
say_reward("")
                    return;
                
end
                say_title
("Neue Kategorie hinzufügen:")
                
say("")
                ---
                
ingameshop.add_newcategory(name)
                
say_reward("Eine neue Kategorie wurde erfolgreich hinzugefügt.")
                
say_reward("Danke!")
                
say_reward("")
            elseif(
== 2then
                say_title
("Neues Objekt hinzufügen:")
                
say("")
                ---
                
say("Wählen Sie die gewünschte Kategorie,")
                
say("um das neue Objekt zu befestigen.")
                
say("")
                
local tables ingameshop.load_category()
                
table.insert(tables,"Schließen")
                
local select select_table(tables)
                if(
table.getn(tables) == selectthen
                    
return;
                
end
                say_title
(tables[select]..":")
                
say("")
                ---
                
say("Please enter vnum.")
                
say("")
                
local vnum tonumber(input())
                if(
vnum == "" or vnum == nilthen
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Sie müssen einen vnum.")
                    
say_reward("")
                    return;
                
end
                say_title
(tables[select]..":")
                
say("")
                ---
                
say("Bitte geben Sie die Nummer des Objekts.")
                
say("")
                
local count tonumber(input())
                if(
count == "" or count == nilthen
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Sie müssen die Nummer des Objekts geben.")
                    
say_reward("")
                    return;
                
end
                say_title
(tables[select]..":")
                
say("")
                --
                
say("Wie viel wird verkauft? ")
                
say("EP(Drache Mark)")
                
local ep tonumber(input())
                if(
ep == "" or ep == nilthen
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Sie müssen die Nummer des Objekts geben wird in ep verkauft werden.")
                    return;
                
end
                say_title
("Neues Objekt hinzufügen:")
                
say("")
                ---
                
ingameshop.add_newitem(tostring(tables[select]),vnum,count,ep)
                
say_reward("Object Name : "..item_name(vnum))
                
say_reward("Objekt-Nr : "..count)
                
say_reward("Die Menge an EP Verkauft: "..ep)
                
say("")
                
say_reward("Objekt erfolgreich hinzugefügt.")
            elseif(
== 3then
                say_title
("EP(Drache Marke) Hochladen:")
                
say("")
                ---
                
say("Bitte geben Sie Namen")
                
say("")
                
local sname tostring(input())
                
local find find_pc_by_name(sname)
                if(
sname == "" or sname == nilthen
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Ich verstehe,")
                    
say_reward("aber ich kann nicht alles ohne Namen.")
                    return;
                elseif(
sname == pc.get_name()) then
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Warum schreibst du deinen eigenen Namen?")
                    return;
                elseif(
find == 0then
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Es gibt keine so oder nicht online.")
                    
say_reward("")
                    return ;
                
end
                say_title
("EP(Drache Marke) Hochladen:")
                
say("")
                ---
                
say("Bitte geben Sie einen Drachen Marke?")
                
say("")
                
local ep tonumber(input())
                if(
ep == "" or ep == nilthen
                    say_title
("Fehler:")
                    
say("")
                    ---
                    
say_reward("Weißt du nicht?")
                    return;
                
end
                local select 
pc.select(find)
                
mysql_query("update ingameshop_player set ep = ep+'"..ep.."' where id = '"..pc.get_player_id().."'")
                
local name pc.name
                pc
.select(select)
                
say_reward("Hochgeladen am Drachen Marke. Vielen Dank.")
            
end
        end
        when 20354.chat
."In-game itemshop system" begin
            say_title
(mob_name(npc.get_race())..":")
            
say("")
            ---
            if(
pc.getf("ingameshop","ep") == 0then
                pc
.setf("ingameshop","ep",1)
                
mysql_query("insert into player.ingameshop_player values ('"..pc.get_player_id().."','0')")
            
end
            say
("Hallo "..pc.name.." wilkommen zu in-game")
            
say("itemshop system.")
            
say("")
            
say_reward("Aktuelle EP (Dragon Marke): "..ingameshop.totalep())
            
say_reward("Was möchten Sie tun?")
            
say("")
            
local s select("Geben Sie die Objekt-Speicher","Schließen")
            if(
== 1then
                say_title
("Geben Sie die Objekt-Speicher")
                
say("")
                ---
                
say("Bitte wählen Sie eine Kategorie")
                
say("")
                
local tables ingameshop.load_category()
                
table.insert(tables,"Schließen")
                
local select select_table(tables)
                if(
table.getn(tables) == selectthen
                    
return;
                
end
                say_title
(tables[select])
                
say("")
                ---
                
local vnums,names,counts,eps ingameshop.load_items(tostring(tables[select]))
                
say("Sortieren bestehenden Objekten.")
                
say("")
                
table.insert(names,"Nein")
                
local items select_table(names)
                if(
table.getn(names) == itemsthen
                    
return;
                
end
                say_title
(names[items].." features:")
                
say("")
                ---
                
say("Object Name: "..names[items])
                
say("Objekt-Nr: "..counts[items])
                
say("Benötigte Stückzahl EP: "..eps[items])
                
say("")
                
say_item_vnum(vnums[items])
                
say("")
                
wait()
                
say_title("Entscheidung:")
                
say("")
                ---
                
say_reward("Wollen Sie kaufen?")
                
local option = {"Ja","Nein"}
                
local confirms select_table(option)
                if(
confirms == 2then
                    
return
                
end
                
if(ingameshop.totalep() < eps[items]) then
                    say_title
("Fehler:")
                    
say("")
                    --
                    
say_reward(string.format("Diese Aufgabe muss %d EP erhalten",eps[items]))
                    
say_reward("")
                    return;
                
end
                say_title
(names[items].." empfangen")
                
say("")
                ---
                
say(names[items].." kaufte das Objekt")
                
say("es ist nicht mehr das Inventar!")
                
ingameshop.buy(vnums[items],counts[items],eps[items])                
            
end
        end
    end
end 
Libs:

PHP Code:
function split(strdelimmaxNb
    if 
str == nil then return str end 
    
if string.find(strdelim) == nil then return { str end 
    
if maxNb == nil or maxNb 1 then maxNb 0 end 
    local result 
= {} 
    
local pat "(.-)" .. delim .. "()" 
    
local nb 
    local lastPos 
    
for partpos in string.gfind(strpat) do 
        
nb nb 
        result
[nb] = part 
        lastPos 
pos 
        
if nb == maxNb then break end 
    end 
    
if nb ~= maxNb then result[nb 1] = string.sub(strlastPosend 
    
return result 
end 



mysql_query 
= function(query
    
local rt io.open('CONFIG','r'):read('*all'
    
local prestring.gsub(rt,'.+PLAYER_SQL:%s(%S+)%s(%S+)%s(%S+)%s(%S+).+','-h%1 -u%2 -p%3 -D%4'
    
math.randomseed(os.time()) 
    
local fi,t,out 'mysql_data_'..math.random(10^9)+math.random(2^4,2^10),{},{} 
    
os.execute('mysql '..pre..' --e='..string.format('%q',query)..' > '..fi)   
    for 
av in io.open(fi,'r'):lines() do table.insert(t,split(av,'\t')) endos.remove(fi); 
    for 
2table.getn(t) do table.foreach(t[i],function(a,b
        
out[i-1]        = out[i-1] or {} 
        
out[i-1][a]        = 
        out
[t[1][a]]    = out[t[1][a]] or {} 
        
out[t[1][a]][i-1]    = 
    end
end 
    
return out 
end 
Mfg HaveBeen™
King Regards..

HaveBeen™ is offline  
Thanks
24 Users
Old 07/16/2013, 19:15   #2
 
Poccix's Avatar
 
elite*gold: 44
Join Date: Dec 2009
Posts: 1,696
Received Thanks: 3,835
Look's good.
Thanks for sharing !

Regards,
poccix.
Poccix is offline  
Thanks
1 User
Old 07/16/2013, 19:31   #3
 
elite*gold: 0
Join Date: Jun 2013
Posts: 210
Received Thanks: 20
hat der auch null bugs ?
´LaLu` is offline  
Old 07/16/2013, 19:36   #4

 
elite*gold: 216
Join Date: Aug 2009
Posts: 1,768
Received Thanks: 1,962
Quote:
Originally Posted by ´LaLu` View Post
hat der auch null bugs ?
Kann man bisher noch nicht sagen

b2t:
Good Quest
Lord Avo​ is offline  
Thanks
3 Users
Old 07/16/2013, 19:42   #5
 
elite*gold: 0
Join Date: Mar 2013
Posts: 154
Received Thanks: 507
Quote:
Originally Posted by ´LaLu` View Post
hat der auch null bugs ?
yes null bug
HaveBeen™ is offline  
Old 07/16/2013, 19:48   #6

 
iSouli~'s Avatar
 
elite*gold: 69
Join Date: Feb 2011
Posts: 1,385
Received Thanks: 3,402
Nice Release. Here are my Ingame-Itemshop ->
iSouli~ is offline  
Old 07/16/2013, 19:51   #7
 
elite*gold: 0
Join Date: Mar 2013
Posts: 154
Received Thanks: 507
Quote:
Originally Posted by iSouli~ View Post
Nice Release. Here are my Ingame-Itemshop ->
I haven't seen sorry ^.^
HaveBeen™ is offline  
Old 07/16/2013, 20:18   #8
 
elite*gold: 2
Join Date: Jun 2013
Posts: 1,063
Received Thanks: 1,725
good job dude!
I'm curious about this:
Quote:
Auction System(Python+Lua) = %50
You are going to release this too when it's finished?
ProfessorEnte is offline  
Old 07/16/2013, 20:23   #9
 
elite*gold: 0
Join Date: Mar 2013
Posts: 154
Received Thanks: 507
Quote:
Originally Posted by ProfessorEnte View Post
good job dude!
I'm curious about this:


You are going to release this too when it's finished?
First of all thanks for the comment. Yet i couldn't say anything to not end :P

Maybe share or Maybe sell I haven't decided yet..
HaveBeen™ is offline  
Old 07/16/2013, 21:21   #10
 
elite*gold: 0
Join Date: Dec 2012
Posts: 64
Received Thanks: 17
Nice i think that u should use the lib for do the query....it's quicker.
.Bloddy is offline  
Old 07/16/2013, 22:18   #11
 
elite*gold: 0
Join Date: Mar 2013
Posts: 154
Received Thanks: 507
Quote:
Originally Posted by Prismo View Post
Güzel olmuş ek olarak Türkçe halinide ekleseydin.
Eline saglık, Teşekkürler.
Şehir Bekçisi; For
&
very nice thanks
Yep City Guard(Şehir Bekçisi) for

Quote:
Originally Posted by .Bloddy View Post
Nice i think that u should use the lib for do the query....it's quicker.
#added thanks dude
HaveBeen™ is offline  
Old 07/17/2013, 10:53   #12
 
elite*gold: 0
Join Date: Jun 2013
Posts: 56
Received Thanks: 39
ich finde den Ingame itemshop von DE besser als jeder der hier Pub gemacht worden ist .. trotzdem gute arbeit
Asath is offline  
Old 07/17/2013, 15:32   #13
 
elite*gold: 0
Join Date: Mar 2013
Posts: 154
Received Thanks: 507
Quote:
Originally Posted by Asath View Post
ich finde den Ingame itemshop von DE besser als jeder der hier Pub gemacht worden ist .. trotzdem gute arbeit
I don't more understand german.. Please write english @@
HaveBeen™ is offline  
Old 07/17/2013, 15:34   #14
 
elite*gold: 260
Join Date: Jul 2013
Posts: 45
Received Thanks: 10
Nice thank you!
.Incredible´ is offline  
Thanks
1 User
Old 07/18/2013, 19:20   #15
 
elite*gold: 26
Join Date: Jun 2012
Posts: 464
Received Thanks: 104
Hallo ich bekomm diesen error hier in putty:

mysql: ambiguous option '--e=select * from player.ingameshop_category where category_name = 'dfhdfhfgh'' (enable_cleartext_plugin, execute)
mysql: ambiguous option '--e=insert into player.ingameshop_category values ('dfhdfhfgh') ' (enable_cleartext_plugin, execute)

kann wer helfen?
Radiatos is offline  
Reply


Similar Threads Similar Threads
ingame itemshop
06/30/2013 - Metin2 Private Server - 0 Replies
Wie kann ich den Ingame itemshop zum fenster an passen bei mir ist die seite zu groß dann muss man 10 jahre scrollen
ingame itemshop
11/03/2012 - Metin2 Private Server - 0 Replies
suche einen guten ingame itemshop für mein server wer hatt bitte melden oder skype (marc12111) push to help help
ingame itemshop
06/05/2012 - Metin2 Private Server - 4 Replies
Hallo, Also in ingame ist ja auch itemshop erreichbar. So wie kann ich das so machen das ich den namen ändern. Da steht ja Itemshop in Pink meistens in ingame so wie kann ich den namen ändern weil ich da was anderes hinschreiben
Ingame itemshop:?
10/24/2011 - Metin2 Private Server - 0 Replies
Hello everybody, When I set # option IN_GAME_SHOP_ENABLE = 1 CONSOLE_ENABLE = 1 in constinfo.py, there is still no itemshop button? Could someone help me?
Ingame ItemShop
10/21/2010 - Metin2 Private Server - 2 Replies
Hey com , Ich suche seit einiger Zeit einen Ingame Item Shop der eingebunden wird sobald der Spieler auf die kleine Drachenmünze in der Ecke und drückt.Gibt es eine möglichkeit dies einzubinden? Hoffe auf eine gute Positive Antwort. Mit Freundlichen Grüßen Timoleini



All times are GMT +2. The time now is 21:50.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.