Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 09:33

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

Advertisement



[Release]Gildenlager/Guildstorage by ProfEnte

Discussion on [Release]Gildenlager/Guildstorage by ProfEnte within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old 08/28/2015, 02:11   #136
 
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
puush
thespeedyy is offline  
Old 08/28/2015, 03:33   #137

 
elite*gold: 183
Join Date: Feb 2010
Posts: 586
Received Thanks: 214
Quote:
ente? wie entferne ich die 6 seite? möchte nur 5 haben
Hab es dir mal angepasst.
Hab aber nur die gs_v1_style2 angepasst
Einfach meine guildstorage.py in der uiscript mit deiner ersetzen und schon haste 5 Seiten


Mfg
Attached Files
File Type: rar guildstorage.rar (1.4 KB, 29 views)
Cynaide™ is offline  
Thanks
1 User
Old 08/28/2015, 09:41   #138
 
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
Hat gefunkt, danke
thespeedyy is offline  
Old 08/28/2015, 15:06   #139
 
elite*gold: 0
Join Date: Aug 2015
Posts: 14
Received Thanks: 1
hallo i have problem with this syser in client:

0827 16:43:07276 :: Traceback (most recent call last):

0827 16:43:07276 :: File "ui.py", line 1493, in OnOverInItem

0827 16:43:07277 :: File "ui.py", line 87, in __call__

0827 16:43:07277 :: File "ui.py", line 78, in __call__

0827 16:43:07277 :: File "uiguildstorage.py", line 218, in OverInItem

0827 16:43:07278 :: File "uiToolTip.py", line 1047, in AddRefineItemData

0827 16:43:07278 :: File "uiToolTip.py", line 1120, in AddItemData

0827 16:43:07279 :: File "uiToolTip.py", line 1545, in __AdjustMaxWidth

0827 16:43:07279 :: File "uiToolTip.py", line 1557, in __AdjustAttrMaxWidth

0827 16:43:07280 :: IndexError
0827 16:43:07280 :: :
0827 16:43:07280 :: list index out of range
0827 16:43:07280 ::

how fix it? Also why i can put only items with 1x slot, when try put withe more slots i get message Dieses Item kann nicht gelagert werden ??
LoniceraWorld1 is offline  
Old 08/28/2015, 17:25   #140
 
elite*gold: 0
Join Date: Feb 2014
Posts: 4
Received Thanks: 2
Hallo Seamless Aber alles, was ich habe ich öffnen Sie die Großhändler Gildenlag sind nie geöffnet , jedoch nicht zu einem Fehler führen Können Sie helfen
onurerkunt is offline  
Thanks
1 User
Old 08/29/2015, 00:21   #141
 
elite*gold: 1
Join Date: Aug 2014
Posts: 1,277
Received Thanks: 842
Quote:
Originally Posted by onurerkunt View Post
Hallo Seamless Aber alles, was ich habe ich öffnen Sie die Großhändler Gildenlag sind nie geöffnet , jedoch nicht zu einem Fehler führen Können Sie helfen
I dont understand anything..
Please in englisch or turk if(!)you can.

lg
.Ryuzaki™ is offline  
Old 08/30/2015, 02:27   #142
 
elite*gold: 0
Join Date: Mar 2010
Posts: 14
Received Thanks: 1
i have the error
`get_attr_type' (a nil value)

i install the function in questlua_item.cpp

and a cant put itens in guild storage
kimameixede is offline  
Old 08/31/2015, 20:21   #143
 
elite*gold: 75
Join Date: Mar 2012
Posts: 2,653
Received Thanks: 738
Kannst du mir vielleicht sagen wie ich das auch "Blocke" das ich von Gildenlager auf Handelscenter, Item´s einfügen kann usw.




#gefixt Danke an Kilroy
.Despero™ is offline  
Old 08/31/2015, 20:44   #144
 
elite*gold: 2
Join Date: Jun 2013
Posts: 1,143
Received Thanks: 1,719
Quote:
Originally Posted by .Despero™ View Post
Kannst du mir vielleicht sagen wie ich das auch "Blocke" das ich von Gildenlager auf Handelscenter, Item´s einfügen kann usw.

Krass. 😁
sollte man in der handelscenter quest überpruefen ob es sich um nen inventarslot handelt.
ProfessorEnte is offline  
Old 09/06/2015, 13:55   #145
 
elite*gold: 14
Join Date: Mar 2015
Posts: 641
Received Thanks: 242
0906 13:50:21403 :: RecvGuildSafeboxPacket: subHeader 4
0906 13:50:21403 :: RecvGuildSafeboxPacket: subHeader 3
0906 13:50:24685 :: RecvGuildSafeboxPacket: subHeader 5

Wo liegt der fehler?
Das gildenlager lässt sich einfach nicht öffnen.
_Ryuk is offline  
Old 09/09/2015, 22:13   #146
 
elite*gold: 0
Join Date: Feb 2011
Posts: 2
Received Thanks: 0
item don't move gildenlager :S
partor is offline  
Old 09/10/2015, 01:01   #147
 
elite*gold: 105
Join Date: Jun 2015
Posts: 453
Received Thanks: 293
Das Gildenlager gefällt mir sehr gut!
Danke fürs teilen!
I´m Raylee is offline  
Old 09/18/2015, 01:25   #148
 
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
Ich habe das Gildenlager per Quest geöffnet.. Jetzt krieg ich es mit nem Button nicht geöffnet sondern nur noch per Quest, warum?
thespeedyy is offline  
Old 09/18/2015, 07:12   #149

 
elite*gold: 83
Join Date: Nov 2013
Posts: 2,891
Received Thanks: 2,751
Quote:
Originally Posted by thespeedyy View Post
Ich habe das Gildenlager per Quest geöffnet.. Jetzt krieg ich es mit nem Button nicht geöffnet sondern nur noch per Quest, warum?
Das gildenlager wird immer per quest geöffnet, über einen Button ruft der Client einfach die quest auf.
Um es über einen Button öffnen zu können muss der trigger "when button or info begin" drin sein
rollback is offline  
Old 09/18/2015, 11:14   #150
 
elite*gold: 0
Join Date: Aug 2012
Posts: 974
Received Thanks: 89
klappt nicht
PHP Code:
--[[
|---------------------------------------------------------------------------------------|
|    
__________                  _____                                                  |
|    \
______   \_______   ____ _________    ______  ______ ____ _______             |
|     |     
___/\_  __ \ /  \\   __\___ \  /  ___/ /  ___//  _ \\_  __ \            |
|     |    |     |  | \/(  <_> )|  |  \  ___/  \___ \  \___ \(  <_> )|  | \/            |
|     |
____|     |__|    \____/ |__|   \___  >/____  >/____  >\____/ |__|               |
|                                          \/      \/      \/                           |
|                       
___________         __                                           |
|                       \
_   _____/  ____ _/  |_   ____                                  |
|                        |    
__)_  /    \\   __\___ \                                 |
|                        |        \|   |  \|  |  \  
___/                                 |
|                       /
_______  /|___|  /|__|   \___  >                                |
|                               \/      \/            \/                                 |
|---------------------------------------------------------------------------------------|
]]

quest guildstorage begin
    state start begin
        when login begin
            cmdchat
("GUILDSTORAGE QID/"..q.getcurrentquestindex())
            
pc.setqf('login',get_time()+15)
        
end
        
        when 9005.chat
"Gildenlager" begin
            setskin
(NOWINDOW)
            
guildstorage.open_gs()
        
end
        
        
function open_gs()
            if 
pc.getqf('login') >= get_time() then syschat'Du kannst das Gildenlager erst 15 Sekunden nach dem Login benutzen.' return end --NEU 06.07.2014
            
if game.get_event_flag('gildenlager') == 0 then syschat'Das Gildenlager ist zurzeit deaktiviert.'  return end
            
if not pc.has_guild() then syschat'Du benoetigst eine Gilde um das Gildenlager benutzen zu koennen.' setskin(NOWINDOW) return end
            
if not guildstorage.has_guildstorage() then guildstorage.create_guildstorage() end
            
if pc.is_polymorphed() then syschat'Du kannst das Gildenlager nicht verwenden wenn du verwandelt bist.' return end -- NEW
            if 
pc.is_guild_master() then 
                cmdchat
('GUILDSTORAGE OPEN/1')
            else
                
cmdchat('GUILDSTORAGE OPEN/0')
            
end
            guildstorage
.refresh()
            
pc.setqf("GUILDSTORAGE",1)
        
end
        
        when button begin
            
if game.get_event_flag('gildenlager') == 0 then syschat'Das Gildenlager ist zurzeit deaktiviert.'  return end
            local cmd 
guildstorage.client_command(getinput("GUILDSTORAGE QUESTCMD"))
            if 
pc.is_polymorphed() and cmd[1] != 'UPDATE' then syschat'Du kannst das Gildenlager nicht verwenden wenn du verwandelt bist.' return end -- NEW
            -- [
ITEM]
            if 
cmd[1] == 'TAKE_ITEM' then
                
if not guildstorage.get_authority(1then syschat'Du besitzt keine Berechtigung hierfuer.' return end
                
-- if pc.get_empty_inventory_count() < 3 then syschat'Du hast nicht genug Platz im Inventar, du brauchst mindestens drei freie Plaetze' return end
                local slot 
tonumber(cmd[2])+120*tonumber(cmd[3])
                
local item guildstorage.get_slot_item(slot)
                if 
not pc.enough_inventory(item[1]) then syschat'Du hast nicht genug Platz im Inventar.' return end
                
                
if guildstorage.slot_empty(slotthen syschat'Dieses Item befindet sich an einer anderen Position, oder wurde schon rausgenommen' return end
                
if game.get_event_flag('GUILDS_USE_'..pc.get_guild()) == 1 then syschat'Fehler #101' return end
                guildstorage
.remove_item(slot)
                
guildstorage.give_item(item)
            elseif 
cmd[1] == 'MOVE_ITEM' then
                item
.select_cell(tonumber(cmd[3]))
                if 
not guildstorage.get_authority(0then syschat'Du besitzt keine Berechtigung hierfuer.' return end
                
--possible to store the itemantiflag/flag
                
if cmd[2] == 'INVENTORY' then
                    
if not guildstorage.slot_empty(tonumber(cmd[4])+120*tonumber(cmd[5])) then syschat'Dieser Slot ist bereits belegt.' return end
                    guildstorage
.insert_item(tonumber(cmd[3]),tonumber(cmd[4]),tonumber(cmd[5]))
                elseif 
cmd[2] == 'GUILDSTORAGE' then
                    
if not guildstorage.slot_empty(tonumber(cmd[5])+120*tonumber(cmd[6])) then syschat'Dieser Slot ist bereits belegt, oder das Item existiert nichtmehr.' return end
                    guildstorage
.move_item(tonumber(cmd[3])+120*tonumber(cmd[4]),tonumber(cmd[5])+120*tonumber(cmd[6]))
                
end
            
-- [MONEY]
            elseif 
cmd[1] == 'TAKE_MONEY' then
                
if not guildstorage.get_authority(3then syschat'Du besitzt keine Berechtigung hierfuer.' return end
                local old_money 
guildstorage.get_money()
                if 
old_money tonumber(cmd[2]) then syschat'Soviel Yang ist nicht im Gildenlager.' return end 
                local new_money 
tonumber(cmd[2])
                if 
new_money+pc.get_money() >= 999999999999 then syschat'Du kannst nicht mehr wie 999.999.999.999 Yang bei dir haben.' return end
                guildstorage
.change_money(-new_money)
                
pc.change_money(new_money)
                
guildstorage.add_log(pc.get_name(),'Yang','abheben',new_money)
                
cmdchat('GUILDSTORAGE REFRESH_MONEY/'..(old_money-new_money))
            elseif 
cmd[1] == 'GIVE_MONEY' then
                
if not guildstorage.get_authority(2then syschat'Du besitzt keine Berechtigung hierfuer.' return end
                local old_money 
guildstorage.get_money()
                
local new_money tonumber(cmd[2])
                if 
new_money pc.get_money() then syschat'Soviel Yang besitzt du nicht' return end
                pc
.change_money(-new_money)
                
guildstorage.change_money(new_money)
                
guildstorage.add_log(pc.get_name(),'Yang','einzahlen',new_money)
                
cmdchat('GUILDSTORAGE REFRESH_MONEY/'..(old_money+new_money))
            -- [
MEMBER]
            elseif 
cmd[1] == 'ADD_MEMBER' then
                
if not pc.is_guild_master() then syschat'Cheese. ;p' return end
                local members 
guildstorage.get_members()
                if 
table.getn(members) >= 12 then syschat'Du kannst maximal nur 12 Member eintragen.' return end
                guildstorage
.add_member(cmd[2])
                
cmdchat('GUILDSTORAGE MEMBER_COMPLETE')
            elseif 
cmd[1] == 'DELETE_MEMBER' then
                
if not pc.is_guild_master() then syschat'Cheese. ;p' return end
                guildstorage
.delete_member(cmd[2])
                
cmdchat('GUILDSTORAGE MEMBER_COMPLETE')
            elseif 
cmd[1] == 'AUTHORITY' then
                
if not pc.is_guild_master() then syschat'Cheese. ;p' return end
                guildstorage
.set_authority(cmd[2],tonumber(cmd[3]),cmd[4])
                
local members guildstorage.get_members()
                for 
1table.getn(members) do
                    -- 
idmembernameauthority 1-4
                    cmdchat
('GUILDSTORAGE_ADDMEMBER '..(i-1)..' '..members[i][1]..' '..members[i][2]..' '..members[i][3]..' '..members[i][4]..' '..members[i][5])
                
end
            
elseif cmd[1] == 'GETMEMBERLIST' then
                
if not pc.is_guild_master() then syschat'Cheese. ;p' return end
                local members 
guildstorage.get_members()
                for 
1table.getn(members) do
                    -- 
idmembernameauthority 1-4
                    cmdchat
('GUILDSTORAGE_ADDMEMBER '..(i-1)..' '..members[i][1]..' '..members[i][2]..' '..members[i][3]..' '..members[i][4]..' '..members[i][5])
                
end
                cmdchat
('GUILDSTORAGE REFRESH_MEMBERS')
            elseif 
cmd[1] == 'UPDATE' then
                guildstorage
.refresh_tempslots()
            elseif 
cmd[1] == 'OPEN' then
                guildstorage
.open_gs()
            elseif 
cmd[1] == 'LOAD_LOGS' then
                
if not pc.is_guild_master() then syschat'Cheese. ;p' return end
                local logs 
guildstorage.load_logs()
                
local logsLen table.getn(logs)
                for 
0logsLen-do
                    
local var = (logsLen-i)
                    
cmdchat('GUILDSTORAGE_ADDLOG '..(var-1)..' '..logs[var][1]..' '..logs[var][2]..' '..logs[var][3]..' '..logs[var][4]..' '..logs[var][5])
                
end
            
elseif cmd[1] == 'DELETE_LOGS' then
                
if not pc.is_guild_master() then syschat'Cheese. ;p' return end
                guildstorage
.clear_logs()
            
end
        end
        
        
function item_can_store(itemvnum)
            
local antiflags guildstorage.item_get_real_antiflags(guildstorage.item_antiflag(itemvnum))
            
local blackListItem = {50821,50822,50823,50824,50825,50826,51002,262176}
            for 
1table.getn(blackListItem) do
                if 
blackListItem[i] == itemvnum then
                    
return false
                end
            end
            
for table.getn(antiflags) do
                if 
antiflags[i] == 128 or antiflags[i] == 131072 or antiflags[i] == 8192 or antiflags[i] == 64 then return false end
                
-- Wenn das item die Antiflag hat wird es nicht eingelagert.
            
end
            
return true
        end
        
        
function item_get_real_antiflags(antiflag_)
            
antiflags = {131072,65536,32768,16384,8192,4096,2048,1024,512,256,128,64,32,16,8,4,2,1}
            
tab2 = {}
            return 
tab2
        end

        
function item_antiflag(item_vnum)
    if 
type(item) ~= "number" then return nil end
    
return tonumber(game.mysql_query("SELECT antiflag FROM player.item_proto WHERE vnum = "..item_vnum.." LIMIT 1;")[1][1])
end
        
        
----------------------
        --
LOGS START
        
----------------------
        
        function 
load_logs()
            
local logs = {}
            
local gs_logs io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/logs.txt""r")
            for 
line in gs_logs:lines() do
                
table.insert(logs,guildstorage.split_(line,"#"))
            
end
            
return logs
        end
        
        
function clear_logs()
            
local gs_log io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/logs.txt""w+")
            
gs_log:flush()
            
gs_log:close()
        
end
        
        
function add_log(name_,type_,do_,desc_)
            
local gs_logs io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/logs.txt""r")
            
local lineCount 0
            
for line in gs_logs:lines() do
                
lineCount lineCount 1
            end
            
if lineCount >= 1000 then
                local gs_log 
io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/logs.txt""w+")
                
gs_log:flush()
                
gs_log:close()
            
end
            local gs_log 
io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/logs.txt""a+")
            
local date_ os.date()
            
date_ string.gsub(date_," ""+-+")
            
desc_ string.gsub(desc_," ""+-+")
            
gs_log:write(name_..'#'..date_..'#'..type_..'#'..do_..'#'..desc_..'\\n')
            
gs_log:flush()
            
gs_log:close()
        
end
        
        
----------------------
        --
LOGS END
        
----------------------
        
        ----------------------
        --
MEMBER AUTHORITY START
        
----------------------
        -- 
Auth 0 einlagern
        
-- Auth 1 rausnehmen
        
-- Auth 2 einzahlen
        
-- Auth 3 auszahlen
        
        
function get_members()
            
local members = {}
            
local gs_member io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/authority.txt""r")
            for 
line in gs_member:lines() do
                
table.insert(members,guildstorage.split_(line,"#"))
            
end
            
return members
        end
        
        
function get_authority(authID)
            if 
pc.is_guild_master() then return true end
            local members 
guildstorage.get_members()
            for 
1table.getn(members) do
                if 
members[i][1] == pc.get_name() then
                    
if tonumber(members[i][authID+2]) == 0 then return false else return true end
                end
            end
            
return false
        end
        
        
function set_authority(member,authID,auth)
            
local members guildstorage.get_members()
            for 
1table.getn(members) do
                if 
members[i][1] == member then 
                    members
[i][authID+2] = auth
                    
break
                
end
            end
            local gs_member 
io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/authority.txt""w+")
            for 
1table.getn(members) do
                
gs_member:write(members[i][1]..'#'..members[i][2]..'#'..members[i][3]..'#'..members[i][4]..'#'..members[i][5]..'\\n')
            
end
            gs_member
:flush()
            
gs_member:close()
        
end
        
        
function add_member(member)
            
local members guildstorage.get_members()
            for 
1table.getn(members) do
                if 
members[i][1] == member then 
                    syschat
'Member ist schon eingetragen.' 
                    
return
                
end
            end
            local gs_member 
io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/authority.txt""a+")
            
gs_member:write(member..'#0#0#0#0\\n')
            
gs_member:flush()
            
gs_member:close()
        
end
        
        
function delete_member(member)
            
local members guildstorage.get_members()
            for 
1table.getn(members) do
                if 
members[i][1] == member then 
                    table
.remove(members,i)
                    break
                
end
            end
            local gs_member 
io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/authority.txt""w+")
            for 
1table.getn(members) do
                
gs_member:write(members[i][1]..'#'..members[i][2]..'#'..members[i][3]..'#'..members[i][4]..'#'..members[i][5]..'\\n')
            
end
            gs_member
:flush()
            
gs_member:close()
        
end
        
        
----------------------
        --
MEMBER AUTHORITY END
        
----------------------
        
        ----------------------
        --
MONEY START
        
----------------------
        function 
get_money()
            
local gs_money io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/money.txt""r")
            for 
line in gs_money:lines() do
                return 
tonumber(line)
            
end
        end
                
        
function change_money(money)
            
local old_money guildstorage.get_money()
            
local gs_money io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/money.txt""w+")
            
gs_money:write(old_money+money)
            
gs_money:flush()
            
gs_money:close()
        
end
        
        
----------------------
        --
MONEY END
        
----------------------
        
        ----------------------
        --
STORAGE START
        
----------------------
        
        function 
has_guildstorage()
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/storage.txt""r")      
            if 
guildstorage == nil then
                
return false
            
else
                return 
true
            end
        end
        
        
function give_item(itemTab)
            
pc.give_item2_select(itemTab[1],itemTab[2])
            
local attr,socket = {},{}
            for 
10,23 do table.insert(attr,{itemTab[i],itemTab[i+1]}) i+1 end
            
for 4,do table.insert(socket,itemTab[i]) end
            
for 1table.getn(attr) do 
                
item.set_value(i-1attr[i][1], attr[i][2]) 
            
end 
            
for 1table.getn(socket) do if tonumber(socket[i]) > 0 then item.set_socket(i-1socket[i])  end end
            game
.set_event_flag('GUILDS_USE_'..pc.get_guild(),0)
        
end

        
function get_slot_item(slot)
            
local items guildstorage.get_items()
            for 
1table.getn(items) do
                
local item guildstorage.split_(items[i],"#")
                if 
tonumber(item[3]) == slot then
                    
return item
                end
            end
            
return 0
        end
        
        
function refresh()
            
cmdchat('GUILDSTORAGE REFRESH_MONEY/'..guildstorage.get_money())
            
local items guildstorage.get_items()
            if 
items != 0 then
                
for 1table.getn(items) do
                    
local item guildstorage.split_(items[i],"#")
                    -- 
chat(table.getn(item))
                    
cmdchat('GUILDSTORAGE_ADDITEM '..item[3]..' '..item[1]..' '..item[2]..' '..item[4]..' '..item[5]..' '..item[6]..' '..item[7]..' '..item[8]..' '..item[9]..' '..item[10]..' '..item[11]..' '..item[12]..' '..item[13]..' '..item[14]..' '..item[15]..' '..item[16]..' '..item[17]..' '..item[18]..' '..item[19]..' '..item[20]..' '..item[21]..' '..item[22]..' '..item[23])
                
end
            end
            cmdchat
('GUILDSTORAGE REFRESH')
        
end
        
        
function refresh_tempslots()
            
cmdchat('GUILDSTORAGE REFRESH_MONEY/'..guildstorage.get_money())
            
cmdchat('GUILDSTORAGE CLEAR_TEMPSLOTS')
            
local items guildstorage.get_items()
            if 
items != 0 then
                
for 1table.getn(items) do
                    
local item guildstorage.split_(items[i],"#")
                    
cmdchat('GUILDSTORAGE_ADDTEMPSLOT '..item[3]..' '..item[1]..' '..item[2]..' '..item[4]..' '..item[5]..' '..item[6]..' '..item[7]..' '..item[8]..' '..item[9]..' '..item[10]..' '..item[11]..' '..item[12]..' '..item[13]..' '..item[14]..' '..item[15]..' '..item[16]..' '..item[17]..' '..item[18]..' '..item[19]..' '..item[20]..' '..item[21]..' '..item[22]..' '..item[23])
                
end
            end
            cmdchat
('GUILDSTORAGE COMPARE_TEMPSLOTS')
        
end
        
        
function slot_empty(slot)
            
local itemList guildstorage.get_items()
            for 
table.getn(itemList) do
                
local item guildstorage.split_(itemList[i],"#")
                if 
tonumber(item[3]) == slot then
                    
return false
                end
            end
            
return true
        end
        
        
function create_guildstorage()
            
os.execute("mkdir "..guildstorage_path.."Guildstorage/"..pc.get_guild())
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/storage.txt""w+")
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/money.txt""w+")
            
guildstorage:write("0")
            
guildstorage:close()
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/authority.txt""w+")
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/logs.txt""w+")
            
guildstorage:close()
        
end
        
        
function insert_item(cell,slot,tab)
            
local result item.select_cell(cell)
            if 
not result then syschat'Probier es nochmal.' return end
            local itemId1 
item.get_id()
            
local itemVnum1 item.get_vnum()
            
item.select_cell(cell
            
local attr = {{item3.get_attr(0)}, {item3.get_attr(1)}, {item3.get_attr(2)}, {item3.get_attr(3)},{item3.get_attr(4)},{item3.get_attr(5)}, {item3.get_attr(6)}}
            
local socketitemCountitemVnum = {item.get_socket(0), item.get_socket(1), item.get_socket(2),item.get_socket(3),item.get_socket(4),item.get_socket(5)}, item.get_count(),item.get_vnum()     
            if 
itemId1 != item.get_id() or itemVnum1 != itemVnum then syschat'wtf?' return end
            
if not guildstorage.item_can_store(itemVnumthen syschat'Dieses Item kann nicht gelagert werden.' return end
            
if itemCount 1 then
                
for 1itemCount do
                    
item.remove()
                    
item.select_cell(cell)
                
end
            
elseif itemCount == 1 then
                item
.remove()
            else
                
chat'Fehler'
                
return
            
end
            cmdchat
('GUILDSTORAGE_ADDITEMSLOT '..slot..' '..tab..' '..itemVnum..' '..itemCount..' '..socket[1]..' '..socket[2]..' '..socket[3]..' '..socket[4]..' '..socket[5]..' '..socket[6]..' '..attr[1][1]..' '..attr[1][2]..' '..attr[2][1]..' '..attr[2][2]..' '..attr[3][1]..' '..attr[3][2]..' '..attr[4][1]..' '..attr[4][2]..' '..attr[5][1]..' '..attr[5][2]..' '..attr[6][1]..' '..attr[6][2]..' '..attr[7][1]..' '..attr[7][2])
            
guildstorage.add_log(pc.get_name(),'Item','einlagern',item_name(itemVnum)..' ('..itemCount..')')
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/storage.txt""a+")
            -- 
syschat(itemVnum.."#"..itemCount.."#"..(slot+120*tab).."#"..socket[1].."#"..socket[2].."#"..socket[3].."#"..socket[4].."#"..socket[5].."#"..socket[6].."#"..attr[1][1].."#"..attr[1][2].."#"..attr[2][1].."#"..attr[2][2].."#"..attr[3][1].."#"..attr[3][2].."#"..attr[4][1].."#"..attr[4][2].."#"..attr[5][1].."#"..attr[5][2].."#"..attr[6][1].."#"..attr[6][2].."#"..attr[7][1].."#"..attr[7][2])
            
guildstorage:write(itemVnum.."#"..itemCount.."#"..(slot+120*tab).."#"..socket[1].."#"..socket[2].."#"..socket[3].."#"..socket[4].."#"..socket[5].."#"..socket[6].."#"..attr[1][1].."#"..attr[1][2].."#"..attr[2][1].."#"..attr[2][2].."#"..attr[3][1].."#"..attr[3][2].."#"..attr[4][1].."#"..attr[4][2].."#"..attr[5][1].."#"..attr[5][2].."#"..attr[6][1].."#"..attr[6][2].."#"..attr[7][1].."#"..attr[7][2].."\\n")
            
guildstorage:flush()
            
guildstorage:close()
        
end
        
        
function remove_item(slot)
            
game.set_event_flag('GUILDS_USE_'..pc.get_guild(),1)
            
local gsPath guildstorage_path.."Guildstorage/"..pc.get_guild().."/storage.txt"
            
local items = {}
            
local itemList guildstorage.get_items()
            if 
slot 720 then syschat'Dieser Slot existiert nicht.' return end
            
for table.getn(itemList) do
                
table.insert(items,guildstorage.split_(itemList[i],"#"))
            
end
            
for 1table.getn(items) do
                if 
items[i][3] == tostring(slotthen 
                    guildstorage
.add_log(pc.get_name(),'Item','rausnehmen',item_name(items[i][1])..' ('..items[i][2]..')')
                    
table.remove(items,i)
                    break
                
end
            end
            local gs 
io.open(gsPath"w+")
            for 
1table.getn(items) do
                
gs:write(items[i][1]..'#'..items[i][2]..'#'..items[i][3]..'#'..items[i][4]..'#'..items[i][5]..'#'..items[i][6]..'#'..items[i][7]..'#'..items[i][8]..'#'..items[i][9]..'#'..items[i][10]..'#'..items[i][11]..'#'..items[i][12]..'#'..items[i][13]..'#'..items[i][14]..'#'..items[i][15]..'#'..items[i][16]..'#'..items[i][17]..'#'..items[i][18]..'#'..items[i][19]..'#'..items[i][20]..'#'..items[i][21]..'#'..items[i][22]..'#'..items[i][23]..'\\n')
            
end
            gs
:flush()
            
gs:close()
        
end
        
        
function get_items()
            
local guildstorageTab = {}
            
local guildstorage io.open(guildstorage_path.."Guildstorage/"..pc.get_guild().."/storage.txt""r")
            for 
item in guildstorage:lines() do
                
table.insert(guildstorageTab,item)
            
end
            
return guildstorageTab or 0
        end
        
        
function move_item(from,to)
            
local gsPath guildstorage_path.."Guildstorage/"..pc.get_guild().."/storage.txt"
            
local items = {}
            
local itemList guildstorage.get_items()
            for 
table.getn(itemList) do
                
table.insert(items,guildstorage.split_(itemList[i],"#"))
            
end
            
for 1table.getn(items) do
                if 
items[i][3] == tostring(fromthen items[i][3] = tostring(toend
            end
            local gs 
io.open(gsPath"w+")
            for 
1table.getn(items) do
                
gs:write(items[i][1]..'#'..items[i][2]..'#'..items[i][3]..'#'..items[i][4]..'#'..items[i][5]..'#'..items[i][6]..'#'..items[i][7]..'#'..items[i][8]..'#'..items[i][9]..'#'..items[i][10]..'#'..items[i][11]..'#'..items[i][12]..'#'..items[i][13]..'#'..items[i][14]..'#'..items[i][15]..'#'..items[i][16]..'#'..items[i][17]..'#'..items[i][18]..'#'..items[i][19]..'#'..items[i][20]..'#'..items[i][21]..'#'..items[i][22]..'#'..items[i][23]..'\\n')
            
end
            gs
:flush()
            
gs:close()
        
end
        
----------------------
        --
STORAGE END
        
----------------------
        function 
client_command(command_)
            return 
guildstorage.split_(command_,"#")
        
end
        
        
function split_(string_,delimiter)
            
local result = { }
            
local from  1
            local delim_from
delim_to string.findstring_delimiterfrom  )
            while 
delim_from do
                
table.insertresultstring.substring_from delim_from-) )
                
from  delim_to 1
                delim_from
delim_to string.findstring_delimiterfrom  )
            
end
            table
.insertresultstring.substring_from  ) )
            return 
result
        end
    end
end 
thespeedyy is offline  
Reply


Similar Threads Similar Threads
[RELEASE] ProfEnte's Gui Creator ALPHA
10/19/2020 - Metin2 PServer Designs, Websites & Scripts - 9 Replies
Langer Text + Idee: http://www.elitepvpers.com/forum/metin2-pserver-d iscussions-questions/3522047-preview-profentes-gui -creator-alpha.html .Kori hats hochgeladen fuer euch: Weiteres: Hab keine Zeit mehr fuer.
[RELEASE] Slotmachine Fruits by ProfEnte
08/12/2020 - Metin2 PServer Guides & Strategies - 84 Replies
UPDATE AUS DEM ANHANG LADEN! http://puu.sh/81MVr.jpg Mal was aus Spaß gebastelt. :D Tutorial zum einfuegen:



All times are GMT +2. The time now is 09:33.


Powered by vBulletin®
Copyright ©2000 - 2021, 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.

BTC: 33E6kMtxYa7dApCFzrS3Jb7U3NrVvo8nsK
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

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