thangth6
21-07-12, 09:01 PM
Code của em nó đây nhờ Pro giúp giùm
Include("\\script\\startup_remix.lua")
Include("\\script\\GetFaction.lua")
Include("\\dulieu\\mabaomat.lua")
Include("\\script\\quanly.lua")
Include("\\script\\checknv.lua")
function logWrite(arg)
local gm_Log = "dulieu/thongtin/"..GetName()..".txt" --ÈÕÖ¾
local fs_log = openfile(gm_Log, "a");
write(fs_log, date("%d-%m-%y_%H:%M:%S").."\t"..arg.."\n");
closefile(fs_log);
end;
idtaskruong = 43 ----- ID task ma ruong
idtasktempp = 37 ----- ID task luu ma ruong tam thoi
idtasktempp1 = 38 ---- ID Task so tang(floor)
idtasktempp2 = 39 ---- ID dieu kien lap mat khau va doi mat khau
a = 0
function main(sel)
w,x,y = GetWorldPos()
if a == 0 then
a = 1
khoidong()
thongtinplay()
end
--if GetLevel() >= 120 then
-- if GetTask(17) < 1440 then
-- SetTimer(60*18,4)
-- end
--end
if GetTask(140) == 1 then
SetFightState(0)
SetTask(140,0)
end
if GetTask(141) == 1 then
SetFightState(0)
SetTask(141,0)
end
if GetTask(142) == 1 then
SetFightState(0)
SetTask(142,0)
end
if SAVEDATAKHILOGIN == 1 then
thongtinplay()
end
if w ~= 44 then
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
Say("§Ó B¶o VÖ Nh©n VËt B¹n, \n<color=yellow>HÖ Thèng TiÕn Hµnh §a Nh©n VËt Lªn §¶o<color> ",1,"Ok/lendao")
else
nhapma()
end
end
function nhapma()
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
Say("§Ó B¶o VÖ Nh©n VËt B¹n, \nXin h·y ®æi <color=yellow>M· B¶o MËt<color> Tr¸nh bÞ hack !\n<color=cyan>§æi M· B¶o VÖ t¹i Thî Söa Khãa Ba L¨ng HuyÖn<color>\n<color=red>MËt KhÈu mÆc ®inh lµ :<color> <color=yellow>000000<color>\nNÕu cha nh©p m©t khÈu, B¹n sÏ ë m·i trªn ®¶o nµy",1,"NhËp m· b¶o vÖ/morp")
end
function thongtinplay()
--logWrite("[Dang Nhap]["..GetName().."][Mon Phai:"..GetFaction().."][Tien Van:"..GetCash().."][Danh Vong:"..GetRepute().."][Phuc Duyen:"..GetTask(12).."][Ngu Ba:"..GetTask(14).."][TTK:"..GetTask(15).."][VLMT:"..GetTask(16).."][TienNganHang:"..GetTask(38).." Van]");
end
function lendao()
if GetLevel() >= LVDUOCDUNGMABAOMAT then
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
NewWorld(44,1584,3280)
DelItem(148)
DelItem(132)
SetFightState(0)
--KickOutSelf()
nhapma()
end
end
function no()
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
NewWorld(44,1584,3280)
DelItem(148)
DelItem(132)
AddGlobalCountNews("Cã ngêi ®ang cè g¾n hack <color=yellow>"..GetName().."<color>",2)
SetFightState(0)
KickOutSelf()
end;
function morp()
SetTaskTemp(idtasktempp2,0)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("NÕu cha ®æi m· b¶o mËt, mËt khÈu mÆc ®Þnh sÏ lµ <color=yellow>000000<color>\nH·y nhËp sè thø <color=yellow>"..GetTaskTemp(idtasktempp1).."<color> trong mËt khÈu",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Tho¸t/no");
end
function dmkp()
SetTaskTemp(idtasktempp2,1)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("NÕu cha ®æi m· r¬ng, mËt khÈu mÆc ®Þnh sÏ lµ <color=yellow>000000<color>\nH·y nhËp sè thø <color=yellow>"..GetTaskTemp(idtasktempp1).."<color> trong mËt khÈu r¬ng cò",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Tho¸t/no");
end
function morp1()
id = random (1,8)
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring1 = a..b..c..d..e..f -- chuoi ma ruong
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
if tring1 == tring2 then
dangnhap() -- dua ve BLH
checknv()
--Talk(1,"","NhËp m· thµnh c«ng !\nMuèn ®æi m· b¶o vÖ g¨p thî söa Khãa !\n\n\n Vµo Game")
else
Talk(1,"no","B¹n ®· nhËp sai m· b¶o mËt.\nNÕu quªn, h·y liªn hÖ GM ®Ó ®c hç trî !")
end
end
function dangnhap()
if GetItemCount(148) == 0 and GetItemCount(132) == 0 then
AddEventItem(132)
AddEventItem(148) --ba lang huyen
checknv()
MoveNPC(53,197,202,6+random(-2,2),4+random(-2,2),500,0);
SetRevPos(53,200*8,200*16)
Msg2Player("Ngåi yªn! Chóng ta ®Õn Ba L¨ng huyÖn")
end
end
function dmkp1()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring1 = a..b..c..d..e..f -- chuoi ma ruong
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTaskTemp(idtasktempp,0)
SetTaskTemp(idtasktempp1,0)
SetTaskTemp(idtasktempp2,0)
if tring1 == tring2 then
dmkp2()
else
Talk(1,"no","B¹n ®· nhËp sai m· b¶o mËt.\nNÕu quªn, h·y liªn hÖ GM ®Ó ®c hç trî !");
end
end
function dmkp2()
SetTaskTemp(idtasktempp2,2)
SetTaskTemp(idtasktempp1,GetTaskTemp(idtasktempp1) +1)
Say("ThiÕt lËp m· b¶o mËt míi\nH·y nhËp sè thø <color=yellow>"..GetTaskTemp(idtasktempp1).."<color> trong mËt khÈu r¬ng",11,"0/luupass","1/luupass","2/luupass","3/luupass","4/luupass","5/luupass","6/luupass","7/luupass","8/luupass","9/luupass","Tho¸t/no");
end
function dmkp3()
local a1,b1,c1,d1,e1,f1 = phantichpas(GetTaskTemp(idtasktempp))
local tring2 = a1..b1..c1..d1..e1..f1 -- chuoi ma ruong moi nhap(tuc thoi)
SetTask(idtaskruong,tonumber(tring2))
hoanthanh()
end
function luupass(sel)
local tang = GetTaskTemp(idtasktempp1)
if GetTaskTemp(idtasktempp2) == 0 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
morp()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
morp()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
morp()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
morp()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
morp()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
morp1()
else
no()
end
elseif GetTaskTemp(idtasktempp2) == 1 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
dmkp()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
dmkp()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
dmkp()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
dmkp()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
dmkp()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
dmkp1()
else
no()
end
elseif GetTaskTemp(idtasktempp2) == 2 then
if tang == 1 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100000)
dmkp2()
elseif tang == 2 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10000)
dmkp2()
elseif tang == 3 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1000)
dmkp2()
elseif tang == 4 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*100)
dmkp2()
elseif tang == 5 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*10)
dmkp2()
elseif tang == 6 then
SetTaskTemp(idtasktempp,GetTaskTemp(idtasktempp)+s el*1)
dmkp3()
else
no()
end
end
end
function hoanthanh()
local a,b,c,d,e,f = phantichpas(GetTask(idtaskruong))
danh_sach_ma[getn(danh_sach_ma)+1] = {GetName(),a..b..c..d..e..f} --Name,MaRuong
local danhsachma = TaoBang(danh_sach_ma,"danh_sach_ma","")
SaveData("dulieu/mabaomat.lua",listruong)
Talk(1,"no","M· b¶o mËt míi : "..a..b..c..d..e..f.."")
end
function phantichpas(task) --- ham by chicken
--local x,len,a,b,c,d,e,f = GetTask(task),0,0,0,0,0,0,0
local x,len = task,0
local a,b,c,d,e,f = 0,0,0,0,0,0
x = tostring(x)
len = strlen(x)
if len < 6 then
for i=1,(6-len) do
x = "0"..x
end
end
a = tonumber(strsub(x,1,1))
b = tonumber(strsub(x,2,2))
c = tonumber(strsub(x,3,3))
d = tonumber(strsub(x,4,4))
e = tonumber(strsub(x,5,5))
f = tonumber(strsub(x,6,6))
return a,b,c,d,e,f
end
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.