|
You last visited: Today at 14:35
Advertisement
mysql_query("UPDATE
Discussion on mysql_query("UPDATE within the Metin2 Private Server forum part of the Metin2 category.
10/03/2014, 22:45
|
#1
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
|
mysql_query("UPDATE
Hallo
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())
But Not Work , Is There Any Thing Wrong ?
|
|
|
10/03/2014, 22:56
|
#2
|
elite*gold: 0
Join Date: Nov 2011
Posts: 1,448
Received Thanks: 1,257
|
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().."';")
|
|
|
10/03/2014, 23:06
|
#3
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
|
I Know But see
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
|
|
|
10/03/2014, 23:09
|
#4
|
elite*gold: 0
Join Date: Mar 2013
Posts: 2,449
Received Thanks: 6,446
|
Code:
mysql_query("UPDATE player.player SET name='"..string.format("%s","[Test]"..pc.get_name()).."' WHERE id = "..pc.get_player_id())
|
|
|
10/03/2014, 23:17
|
#5
|
elite*gold: 1000
Join Date: Mar 2009
Posts: 1,408
Received Thanks: 1,006
|
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:
Code:
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
|
|
|
10/03/2014, 23:20
|
#6
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
|
Quote:
Originally Posted by [iRemix]
Code:
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:
Code:
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
|
Did You Read My Reply ?
|
|
|
10/03/2014, 23:33
|
#7
|
elite*gold: 1000
Join Date: Mar 2009
Posts: 1,408
Received Thanks: 1,006
|
Quote:
Originally Posted by MrLibya
Did You Read My Reply ?
|
Honestly no. 
So it's changing the name and level after relogg, but doesn't execute the say() functions?!
Does u'r syserr sais anything?
|
|
|
10/04/2014, 00:16
|
#8
|
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
|
Quote:
Originally Posted by Coniesan
Honestly no. 
So it's changing the name and level after relogg, but doesn't execute the say() functions?!
Does u'r syserr sais anything?
|
My Syserr Sleep 
Just Kidding :
Code:
SYSERR: Sep 29 01:36:21 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 01:41:19 :: heart_idle: losing 182 seconds. (lag occured)
SYSERR: Sep 29 01:42:02 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 01:42:27 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 01:49:35 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 01:49:42 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 01:50:19 :: ChildLoop: AsyncSQL: query failed: Column count doesn't match value count at row 1 (query: INSERT DELAYED INTO money_log VALUES (NOW(), 8, 27001, 78) errno: 1136)
SYSERR: Sep 29 01:50:19 :: ChildLoop: AsyncSQL: query failed: Column count doesn't match value count at row 1 (query: INSERT DELAYED INTO money_log VALUES (NOW(), 8, 27002, 874) errno: 1136)
SYSERR: Sep 29 01:52:38 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 01:52:45 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 01:53:26 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 01:53:32 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 01:54:09 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 01:54:11 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 02:32:17 :: heart_idle: losing 111 seconds. (lag occured)
SYSERR: Sep 29 02:33:03 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 02:33:12 :: Select: wrong QUEST_SELECT request! : 57766
SYSERR: Sep 29 02:34:55 :: heart_idle: losing 38 seconds. (lag occured)
SYSERR: Sep 29 02:35:21 :: operator(): QUEST NOT END RUNNING on Login/Logout - PRO
SYSERR: Sep 29 02:35:42 :: Select: wrong QUEST_SELECT request! : 57766
UP
UP
|
|
|
Similar Threads
|
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
|
All times are GMT +1. The time now is 14:36.
|
|