I Made A Quest To Change Plyer Name + Level So I Write Like That :
Code:
mysql_query("UPDATE player.player SET name="..string.format("%q","[Test]"..pc.get_name()).." WHERE id = "..pc.get_player_id())
mysql_query("UPDATE player.player SET level=1 WHERE id = "..pc.get_player_id())
Do you give the database enough time to update? The player has to logout for some minutes.
Code:
mysql_query("UPDATE player.player SET name='[Test]"..pc.get_name()).."' WHERE id = '"..pc.get_player_id().."';")
mysql_query("UPDATE player.player SET level=1 WHERE id = '"..pc.get_player_id().."';")
When I Select Yes He Say Some Word Then Make Notice
But In The Game When I Select Yes He Just Close The Windos without any wrods , notice
+ nothing change in level or name , even if i logout
U have to note, that the game is caching big data parts and syncs it every 8-10min with the database. So u'r methode don't work cause u have w8 (logged out) till the game is syncing.
Would use the "default" Quest for that:
quest chagne_name begin
state start begin
when 71055.use begin
if pc.is_married() then
say("You cannot change your name if you are married.")
say("")
return
end
if pc.is_polymorphed() then
say("You cannot change your name if you are transformed.")
say("")
return
end
if pc.has_guild() then
say("You cannot change your name if you are in the guild. ")
say("")
return
end
if party.is_party() then
say("You cannot change your name if you are in group.")
say("")
return
end
if pc.get_level() < 50 then
say("You cannot change your name if your level is not higher than lever 49.")
say("")
return
end
if get_time() < pc.getqf("next_time") then
say("You can not use it now.")
say("")
if is_test_server() == true then
say("Since it's test server, you can go")
say("")
else
return
end
end
say("Please enter the name you want to have") ;
local name = pc.name ;
local str = input() ;
local ret = pc.change_name(str) ;
if ret == 0 then
say("You didn't log in after you have changed your name.")
say("please re-log in.")
say("")
char_log(0, "CHANGE_NAME", "HAVE NOT RE-LOGIN")
elseif ret == 1 then
say("The problem occured while using the item.")
say("Please use again.")
say("")
char_log(0, "CHANGE_NAME", "ITEM USE PROBLEM")
elseif ret == 2 then
say("The name is not available.")
say("Please enter other name.")
say("")
char_log(0, "CHANGE_NAME", "CAN NOT USE NAME")
elseif ret == 3 then
say("The name is not available.")
say("Please enter other name.")
say("")
char_log(0, "CHANGE_NAME", "ALREADY USING NAME")
elseif ret == 4 then
say("You have changed your name successfully.")
say("Please log in again.")
say("")
item.remove() ;
pc.setqf("next_time", get_time() + time_hour_to_sec(24*15))
char_log(0, "CHANGE_NAME", "SUCCESS: from "..name.." to "..str)
else
say("Unknown error occured.")
say(ret)
char_log(0, "CHANGE_NAME", "UNKNOWN NAME")
end
end
end
end
mysql_query("UPDATE player.player SET name='"..string.format("%s","[Test]"..pc.get_name()).."' WHERE id = "..pc.get_player_id())
Same
Quote:
Originally Posted by Coniesan
U have to note, that the game is caching big data parts and syncs it every 8-10min with the database. So u'r methode don't work cause u have w8 (logged out) till the game is syncing.
Would use the "default" Quest for that:
quest chagne_name begin
state start begin
when 71055.use begin
if pc.is_married() then
say("You cannot change your name if you are married.")
say("")
return
end
if pc.is_polymorphed() then
say("You cannot change your name if you are transformed.")
say("")
return
end
if pc.has_guild() then
say("You cannot change your name if you are in the guild. ")
say("")
return
end
if party.is_party() then
say("You cannot change your name if you are in group.")
say("")
return
end
if pc.get_level() < 50 then
say("You cannot change your name if your level is not higher than lever 49.")
say("")
return
end
if get_time() < pc.getqf("next_time") then
say("You can not use it now.")
say("")
if is_test_server() == true then
say("Since it's test server, you can go")
say("")
else
return
end
end
say("Please enter the name you want to have") ;
local name = pc.name ;
local str = input() ;
local ret = pc.change_name(str) ;
if ret == 0 then
say("You didn't log in after you have changed your name.")
say("please re-log in.")
say("")
char_log(0, "CHANGE_NAME", "HAVE NOT RE-LOGIN")
elseif ret == 1 then
say("The problem occured while using the item.")
say("Please use again.")
say("")
char_log(0, "CHANGE_NAME", "ITEM USE PROBLEM")
elseif ret == 2 then
say("The name is not available.")
say("Please enter other name.")
say("")
char_log(0, "CHANGE_NAME", "CAN NOT USE NAME")
elseif ret == 3 then
say("The name is not available.")
say("Please enter other name.")
say("")
char_log(0, "CHANGE_NAME", "ALREADY USING NAME")
elseif ret == 4 then
say("You have changed your name successfully.")
say("Please log in again.")
say("")
item.remove() ;
pc.setqf("next_time", get_time() + time_hour_to_sec(24*15))
char_log(0, "CHANGE_NAME", "SUCCESS: from "..name.." to "..str)
else
say("Unknown error occured.")
say(ret)
char_log(0, "CHANGE_NAME", "UNKNOWN NAME")
end
end
end
end
mysql_query("select 05/08/2014 - Metin2 Private Server - 9 Replies Hallo
That My First Time To Use Mysql In Quest
So Litile Help PLz:)
You See In The Quest :
when login begin
local title = mysql_query("select * from player.news where id = '"..l.."' ")
local title_table = {}
"100CAP"New Update"New Life"All accepted that"VSRO Filles"500 SILKS free"Trade based 12/01/2012 - SRO PServer Advertising - 37 Replies "As regards im here back to advertise all about new cap on AddictedSro"We are moving to cap 100" All users voted for that and ive do that JOB !
And lets start !
Server Name
-AddictedSro
Server News/COLOR]
-We will upgrade pk2 tomorow 2 !
-We will improve new shop system !
Server Details
-Cap: 100
-Skils: 100