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 00:20

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

Advertisement



Use i/o for save data instead of qf and event flag

Discussion on Use i/o for save data instead of qf and event flag within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2012
Posts: 64
Received Thanks: 17
Use i/o for save data instead of qf and event flag

Hello epvp,
This is my first release
I see in a lot of post that people use qf and event flag and it's the way slower and wrong to save data because is very simple bug the flag and because with qf or flag cant save string...
So i do a small release using i/o.
Here we are.
Add two folder in quest: data_local and data_global
Now add this code in quest_lib editing the directory of the two folder
Code:
Data_Local = "/usr/game1/channel1/share_data/locale/germany/quest/data_local/"
Data_Global = "/usr/game1/channel1/share_data/locale/germany/quest/data_global/"

function write(name,value)
			name_player = pc.get_name()
			io.output(Data_Local..pc.get_player_id().."_"..name)
				io.write(value)
				io.flush()
				io.close()
		end
		function read(name)
			name_player = pc.get_name()
			io.input(Data_Local..pc.get_player_id().."_"..name)
			local valore=tostring(io.read())
			return valore
		end
		function write_global(name,value)
			io.output(Data_Global..name)
				io.write(value)
				io.flush()
				io.close()
		end
		function read_global(name)
			io.input(Data_Global..name)
			local valore=tostring(io.read())
			return valore
		end
Add the function in quest_function
read_global
write_global
read
write

Now I write a simple quest for showing that is the same
Code:
quest testing begin
	state start begin
		when 20086.take begin
			write_global("test","Simple Test with i/o")
			local i = read_global("test")
			say(i)
			
               end
	end
end
Good bye.
.Bloddy is offline  
Thanks
3 Users
Old 04/02/2013, 15:38   #2
 
Stαgє6's Avatar
 
elite*gold: 0
Join Date: Jul 2011
Posts: 2,018
Received Thanks: 1,471
Not bad ^^
Stαgє6 is offline  
Old 04/02/2013, 15:45   #3
 
TraxWall's Avatar
 
elite*gold: 0
Join Date: Oct 2010
Posts: 178
Received Thanks: 86
cool
TraxWall is offline  
Old 04/02/2013, 15:53   #4
 
lollo_9_1's Avatar
 
elite*gold: 100
Join Date: Jun 2009
Posts: 168
Received Thanks: 711
Quote:
Originally Posted by bloddy
Code:
Data_Local = "/usr/game1/channel1/share_data/locale/germany/quest/data_local/"
Data_Global = "/usr/game1/channel1/share_data/locale/germany/quest/data_global/"
Try this:
Code:
Data_Local = "locale/germany/quest/data_local/"
Data_Global = "locale/germany/quest/data_global/"
--or
Data_Local = get_locale_base_path().."/quest/data_local/"
Data_Global = get_locale_base_path().."/quest/data_local/"
And:
Quote:
Originally Posted by bloddy
Code:
pc.get_name()
Code:
pc.get_player_id()
There'll be too problems if u change a name
lollo_9_1 is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
Flag event So-Ok
11/29/2011 - SRO Private Server - 0 Replies
10 ice trophy give : all time 9 degre lucky stone how I can change it.example change with 11 degre sql tablo ? or prosedure ?
i have a some problem on data save
11/13/2010 - Shaiya Private Server - 13 Replies
hi great boys i have a some problem with my shaiya server (ep4) im shaiya server ep4 created using this topic How to: Shaiya Server with EP4 but when i do not save the output game for example: any npc, any ap items or other and fails to "connection with server has been disconnected error 2" but all dress is recorded what can i do this problem :(
Event flag ?
10/05/2010 - Silkroad Online - 12 Replies
How to register in it i have 10 Trofeis
[Warsong] [Walljump] Save Place f0r Flag
03/21/2008 - WoW Exploits, Hacks, Tools & Macros - 4 Replies
// ENTRANCE http://img527.imageshack.us/img527/4474/wowscrnsh ot032008154920xd7.th.jpg \\ EXIT http://img219.imageshack.us/img219/4952/wowscrnsh ot032008154928wj6.th.jpg



All times are GMT +2. The time now is 00:20.


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.