PHP Code:
--[[
-- Character Clearing System
-- Quest Writer By : HaveBeen™
]]--
quest swap begin
state start begin
when 20017.chat."I want to switch two Account's passwords" with math.floor(24*60*60) < get_global_time() - pc.getqf("change") begin
say_title(mob_name(npc.get_race())..":")
say("")
---
say("Hi "..pc.name)
say("How can I help you? ")
say("Hmm. You want to switch between characters' accounts' passwords")
say("So,enter the name of the character")
local sname = tostring(input())
local search = find_pc_by_name(sname)
say_title(mob_name(npc.get_race())..":")
say("")
---
if(sname == "" or tostring(sname) == nil) then
return say_reward("You didn't enter the name of the character.. ")
elseif(sname == pc.name) then
return say_reward("You can't enter your own name")
elseif(search == 0) then
return say_reward("There's no one like this")
end
say("Person is found! ")
say("Please wait. ")
local agree = confirm(search,"Do you want to switch passwords with "..pc.name.." character? ",30)
if(agree != CONFIRM_OK) then
say_title(mob_name(npc.get_race())..":")
say("")
---
say(sname.." didn't accept the request. ")
return
end
say_title(mob_name(npc.get_race())..":")
say("")
---
local myquery = mysql_query("SELECT login,password FROM account.account WHERE id = '"..pc.get_account_id().."' ")
local youquery = mysql_query("SELECT login,password FROM account.account WHERE id = '"..pc.get_account_id(sname).."' ")
local a,b
a = myquery.password[1]
b = youquery.password[1]
mysql_query("UPDATE account.account SET password = '"..b.."' WHERE id = '"..pc.get_account_id().."' ")
mysql_query("UDATE account.account SET password = '"..a.."' WHERE id = '"..pc.get_account_id(sname).."' ")
say("Account information is transferred. ")
say("Please wait! ")
chat("Account Name : "..youquery.login[1])
chat("Account Password : The Same.. ")
pc.setqf("change",get_global_time())
command("quit")
local c = pc.select(search)
chat("Account Name : "..myquery.login[1])
chat("Account Password : The Same.. ")
pc.setqf("change",get_global_time())
command("quit")
pc.select(c)
end
end
end
Thank you I think.. this is useful. but it need some changes