PDA

View Full Version : [JX] Script timerserver.lua ko chạy dù đã dùng mọi cách



keraotinh
21-06-12, 08:32 PM
File script timerserver.lua ko chạy bất cứ event cũng như bất cứ dòng thông báo nào .


Include("\\Script\\source\\sourcejx49.lua")
Include("\\script\\lien_dau\\liendau_head.lua")
Include("\\script\\phonglangdo\\thoigianpld.lua")


npcadd={0,0,0,0,0}
function OnTimer()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
SubWorld = SubWorldID2Idx(53)
phonglangdo()
vuotai()
thoigianbosshk()
print("So luong gamer dang online: "..GetPlayerCount().."");
if (gio == 12) or (gio == 18) then
if phut == 0 then
hat_huy_hoang()
Msg2SubWorld("Th«ng b¸o: H¹t huy hoµng ®· xuÊt hiÖn t¹i ba l¨ng huyÖn (194/204)")
elseif phut == 10 then
del_hat_hh()
qua_huy_hoang()
Msg2SubWorld("Th«ng b¸o: Qu¶ huy hoµng ®· xuÊt hiÖn t¹i ba l¨ng huyÖn (194/204)")
elseif phut == 15 then
del_qua_hh()
end
end



if phut == 6 or phut == 16 or phut == 26 or phut == 36 or phut == 43 then
AddGlobalCountNews("Nh¾c nhë: ch¬i game ®iÒu ®é, v¨n ho¸, gi÷ g×n søc khoÎ...",1)
elseif phut == 8 or phut == 18 or phut == 28 or phut == 38 then
AddGlobalCountNews("Nh¾c nhë: h·y ®Æt kho¸ r­¬ng ®Ó b¶o vÖ tµi s¶n c¸ nh©n !",1)
end

if ((gio == 10) or (gio == 12) or (gio == 14) or (gio == 16) or (gio == 18) or (gio == 20) or (gio == 22)) and (phut >= 45) then
phutcl = 60 - phut
AddGlobalCountNews("Tèng kim ®ang trong thêi gian b¸o danh, cßn "..phutcl.." phót...",1)
if (phut == 59) then
SetGlbMissionV(81,0)
SetGlbMissionV(82,0)
SetGlbMissionV(83,0)
SetGlbMissionV(84,0)
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
DelNpc(npcadd[1])
DelNpc(npcadd[2])
return
end
end


end

elseif (gio == 11) or (gio == 13) or (gio == 15) or (gio == 17) or (gio == 19) or (gio == 21) or (gio == 23) then
if (phut == 0) then

AddGlobalCountNews("Tèng kim ®¹i chiÕn chÝnh thøc b¾t ®Çu !",1)

elseif (phut == 5) or (phut == 10) then

AddGlobalCountNews("Tèng kim tÝch lòy hiÖn t¹i lµ Tèng : Kim "..GetGlbMissionV(81).." : "..GetGlbMissionV(82),1)

elseif (phut == 20) then

if (GetGlbMissionV(81) > GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
idnpc = random(894,898)
tongkim = SubWorldID2Idx(51)
npcadd[2] = AddNpc(idnpc,99,tongkim,1968*32,2700*32)
IsBoss(npcadd[2],2)
SetNpcScript(npcadd[2], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe kim ®· xuÊt hiÖn, h·y cè g¾ng lËp c«ng",1)
return
end
end
elseif (GetGlbMissionV(81) < GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
idnpc = random(889,893)
tongkim = SubWorldID2Idx(51)
npcadd[1] = AddNpc(idnpc,99,tongkim,1722*32,3044*32)
IsBoss(npcadd[1],2)
SetNpcScript(npcadd[1], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe tèng ®· xuÊt hiÖn, h·y cè g¾ng lËp c«ng",1)
return
end
end

elseif (GetGlbMissionV(81) == GetGlbMissionV(82)) then
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
tongkim = SubWorldID2Idx(51)
idnpc = random(889,893)
npcadd[1] = AddNpc(idnpc,99,tongkim,1722*32,3044*32)
SetNpcScript(npcadd[1], "\\script\\tongkim\\nguyensoai.lua");
idnpc = random(894,898)
npcadd[2] = AddNpc(idnpc,99,tongkim,1968*32,2700*32)
SetNpcScript(npcadd[2], "\\script\\tongkim\\nguyensoai.lua");
AddGlobalCountNews("Tèng kim : Nguyªn so¸i phe kim vµ tèng ®· xuÊt hiÖn",1)
return
end
end
end
elseif (phut == 30) then

if (GetGlbMissionV(81) > GetGlbMissionV(82)) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn kÕt thóc, phÇn th¾ng thuéc vÒ phe tèng !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end

SetTask(21,GetTask(21) + 500)
AddRepute(50)
Msg2Player("Tèng kim kÕt thóc, nhËn ®­îc 10 Tói Nguyªn LiÖu, 50 danh väng, 500 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
elseif (GetTask(23) == 1) then
for i=1,20 do
AddEventItem(137)
end

SetTask(21,GetTask(21) + 1000)
AddRepute(100)
Msg2Player("Tèng kim kÕt thóc, nhËn ®­îc 20 Tói Nguyªn LiÖu, 100 danh väng, 1000 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
end
end
end
elseif (GetGlbMissionV(81) < GetGlbMissionV(82)) then
AddGlobalCountNews("Tèng kim ®¹i chiÕn kÕt thóc, phÇn th¾ng thuéc vÒ phe kim !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 1) then
for i=1,10 do
AddEventItem(137)
end

SetTask(21,GetTask(21) + 500)
AddRepute(50)
Msg2Player("Tèng kim kÕt thóc, nhËn ®­îc 10 Tói Nguyªn LiÖu, 50 danh väng, 500 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
elseif (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end

SetTask(21,GetTask(21) + 1000)
AddRepute(100)
Msg2Player("Tèng kim kÕt thóc, nhËn ®­îc 20 Tói Nguyªn LiÖu, 100 danh väng,1000 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
end
end
end
else
AddGlobalCountNews("Tèng kim kÕt thóc, 2 bªn hßa nhau !")
for i=1,200 do
PlayerIndex = i
if (GetUUID() ~= 0) then
if (GetTask(23) == 1) then
for i=1,10 do
AddEventItem(137)
end

SetTask(21,GetTask(21) + 750)
AddRepute(75)
Msg2Player("Tèng kim kÕt thóc, nhËn ®­îc 10 Tói Nguyªn LiÖu, 75 danh väng, 750 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 1640
toadoy = 3153
NewWorld(51,toadox,toadoy) -- tong
SetFightState(0)
elseif (GetTask(23) == 2) then
for i=1,10 do
AddEventItem(137)
end

SetTask(21,GetTask(21) + 750)
AddRepute(75)
Msg2Player("Tèng kim kÕt thóc, nhËn ®­îc 10 Tói Nguyªn LiÖu, 750 danh väng,750 ®iÓm tÝch lòy")
SetTask(24,0)
SetTask(25,0)
SetTask(26,0)
toadox = 2047
toadoy = 2594
NewWorld(51, toadox, toadoy);
SetFightState(0)
end
end
end

end
SetGlbMissionV(81,0)
SetGlbMissionV(82,0)
SetGlbMissionV(83,0)
SetGlbMissionV(84,0)
end
end
--if (gio == 8) or (gio == 14) or (gio == 18) or (gio == 21) then
--if (phut == 0) or (phut == 10) or (phut == 20) or (phut == 30) or (phut == 40) or (phut == 50) then
--AddGlobalCountNews("Liªn ®Êu ®ang trong giai ®o¹n b¸o danh, h·y nhanh ®Õn b¸o danh !",1)
--end
--else
--for i=1,GetPlayerCount() do
--PlayerIndex = i
--w,x,y = GetWorldPos()
-- if w == 42 or w == 43 then
-- NewWorld(53, 1603, 3210);
-- SetFightState(0)
-- end
--end
--end
end

function thoigianbosshk()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
if gio >= 7 and gio <= 9 then
if phut == 0 then
--if GetGlbMissionV(90) == 0 then
map = SubWorldID2Idx(53)
bosstieu1 = AddNpc(509,80,map,1513*32,3306*32)
SetNpcSeries(bosstieu1,random(0,4))
IsBoss(bosstieu1,2)
Msg2SubWorld("LiÔu Thanh Thanh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(188/206)")
----
bosstieu2 = AddNpc(510,80,map,1761*32,3206*32)
SetNpcSeries(bosstieu2,random(0,4))
IsBoss(bosstieu2,2)
Msg2SubWorld("DiÖu Nh­ ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(220/200)")
----
bosstieu3 = AddNpc(511,80,map,1637*32,3057*32)
SetNpcSeries(bosstieu3,random(0,4))
IsBoss(bosstieu3,2)
Msg2SubWorld("Tr­¬ng T«ng ChÝnh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(204/190)")
AddGlobalCountNews("Boss hoµng kim tiÓu ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn, c¸c nh©n sü h·y cÈn thËn",1)
--SetGlbMissionV(90,1)
--else
--Msg2SubWorld("LiÔu Thanh Thanh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(188/206)")
--Msg2SubWorld("DiÖu Nh­ ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(220/200)")
--Msg2SubWorld("Tr­¬ng T«ng ChÝnh ®· xuÊt hiÖn t¹i Ba L¨ng HuyÖn(204/190)")

--end
end
else
--SetGlbMissionV(90,0)
DelNpc(bosstieu1)
DelNpc(bosstieu2)
DelNpc(bosstieu3)
end
if gio >= 19 and gio <= 23 then
if phut == 0 then
--if GetGlbMissionV(90) == 0 then
map = SubWorldID2Idx(9)
bossdai1 = AddNpc(500,100,map,1721*32,3239*32)
SetNpcSeries(bossdai1,random(0,4))
IsBoss(bossdai1,2)
Msg2SubWorld("Gia LuËt TÞ Li ®· xuÊt hiÖn t¹i Sa M¹c II(215/201)")

map = SubWorldID2Idx(8)
bossdai2 = AddNpc(502,100,map,1569*32,3294*32)
SetNpcSeries(bossdai2,random(0,4))
IsBoss(bossdai2,2)
Msg2SubWorld("Cæ B¸ch ®· xuÊt hiÖn t¹i Sa M¹c I (195/205)")
bossdai3 = AddNpc(504,100,map,1398*32,3268*32)
SetNpcSeries(bossdai3,random(0,4))
IsBoss(bossdai3,2)
Msg2SubWorld("YÕn HiÓu Trai ®· xuÊt hiÖn t¹i Sa M¹c I (174/204)")

map = SubWorldID2Idx(8)
bossdai4 = AddNpc(503,100,map,1817*32,2813*32)
SetNpcSeries(bossdai4,random(0,4))
IsBoss(bossdai4,2)
Msg2SubWorld("TuyÒn C« Tö ®· xuÊt hiÖn t¹i M¹c Cao QuËt(226/175)")

map = SubWorldID2Idx(37)
bossdai5 = AddNpc(499,100,map,1399*32,3052*32)
SetNpcSeries(bossdai5,random(0,4))
IsBoss(bossdai5,2)
Msg2SubWorld("§¹o Th¹ch Ch©n Nh©n ®· xuÊt hiÖn t¹i T­¬ng D­¬ng(174/190)")
bossdai6 = AddNpc(501,100,map,1700*32,3355*32)
SetNpcSeries(bossdai6,random(0,4))
IsBoss(bossdai6,2)
Msg2SubWorld("Hµ Nh©n Ng· ®· xuÊt hiÖn t¹i T­¬ng D­¬ng(212/209)")

--map = SubWorldID2Idx(38)
--bossdai7 = AddNpc(506,100,map,1601*32,2819*32)
--SetNpcSeries(bossdai7,random(0,4))
--IsBoss(bossdai7,2)
--Msg2SubWorld("B¹ch Doanh Doanh ®· xuÊt hiÖn t¹i BiÖn Kinh(200/176)")

map = SubWorldID2Idx(36)
bossdai8 = AddNpc(507,100,map,1420*32,3270*32)
SetNpcSeries(bossdai8,random(0,4))
IsBoss(bossdai8,2)
Msg2SubWorld("Hµ Linh Phiªu ®· xuÊt hiÖn t¹i Ph­îng T­êng(177/204)")

--map = SubWorldID2Idx(39)
-- bossdai9 = AddNpc(505,100,map,1550*32,3365*32)
-- SetNpcSeries(bossdai9,random(0,4))
-- IsBoss(bossdai9,2)
-- Msg2SubWorld("HuyÒn Gi¸c ®· xuÊt hiÖn t¹i D­¬ng Ch©u(193/210)")
--SetGlbMissionV(90,1)
--else
---Msg2SubWorld("Gia Luat Ti Li tai Sa Mac II (215/201)")
--Msg2SubWorld("Co Bach da tai Sa Mac I (195/205)")
--Msg2SubWorld("Yen Hieu Trai tai Sa Mac I (174/204)")
--Msg2SubWorld("Tuyen Co Tu tai Mac Cao Quat (226/175)")
--Msg2SubWorld("Dao Thanh Chan Nhan tai Tuong Duong (174/190)")
-- Msg2SubWorld("Ha Nhan Nga tai Tuong Duong (212/209)")
--Msg2SubWorld("Bach Doanh Doanh tai Bien Kinh (200/176)")
-- Msg2SubWorld("Ha Linh Phieu tai Phuong Tuong (177/204)")
-- Msg2SubWorld("Huyen Giac Dai Su tai Duong Chau (193/210)")
--end
end
else
--SetGlbMissionV(90,0)
DelNpc(bossdai1)
DelNpc(bossdai2)
DelNpc(bossdai3)
DelNpc(bossdai4)
DelNpc(bossdai5)
DelNpc(bossdai6)
--DelNpc(bossdai7)
DelNpc(bossdai8)
--DelNpc(bossdai9)
end
end



function vuotai()
ngay = tonumber(date("%d"))
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
giay = tonumber(date("%S"))
if gio == 1 or gio == 3 or gio == 7 or gio == 9 or gio == 11 or gio == 13 or gio == 15 or gio == 17 or gio == 19 or gio == 21 or gio == 23 then
if phut > 45 then
thongbaova()
elseif phut < 45 and phut > 40 then
tgva = 45-phut
AddGlobalCountNews("Sù kiÖn v­ît ¶i b¾t ®Çu sau "..tgva.." phót n÷a",1)
elseif phut == 45 then
AddGlobalCountNews("Thêi gian b¸o danh v­ît ¶i b¾t ®Çu !!!",1)
end
else
if phut == 0 then
chiendauva()
elseif phut == 46 then
vuotaitime()
AddGlobalCountNews("Sù kiÖn v­ît ¶i kÕt thóc !!!!!!",1)
end
end
if gio == 11 or gio == 17 then
if phut >= 55 then
thoigian = 60-phut
AddGlobalCountNews("Sù kiÖn hoa ®¨ng sÏ b¾t ®Çu sau: "..thoigian.." phót n÷a !",1)
end
end
end
function thongbaova()
w,x,y = GetWorldPos();
a = 60 - phut
for o=1,1000 do
PlayerIndex = o
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
Msg2Player("Sù kiÖn vuît ¶i cßn: "..a.." phót n÷a sÏ b¾t ®Çu !")
end
end
end


function chiendauva()
w,x,y = GetWorldPos();
for u = 1,1000 do
PlayerIndex = u
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
SetFightState(1)
Msg2Player("Sù kiÖn V­ît ¶i b¾t ®Çu. Nhãm cña b¹n cã 45 phót ®Ó v­ît qua !")
end
end
end
function vuotaitime()
phut = tonumber(date("%M"))
gio = tonumber(date("%H"))
SetGlbMissionV(38,0)
SetGlbMissionV(34,0)
for q = 1,1000 do
PlayerIndex = q
if GetTaskTemp(25) == 1 or GetTaskTemp(26) == 1 then
NewWorld(53, 200*8, 200*16);
SetTaskTemp(25,0)
SetDeathScript("");
SetFightState(0);
SetPunish(0)
Msg2Player("Sù kiÖn V­ît ¶i kÕt thóc, B¹n ®· qu¸ 45 phót nh­ng vÉn toµn m¹ng. Tuy nhiªn, vÉn kh«ng ®ñ ®Ó chiÕn th¾ng !")
end
end
end


function vuotai1()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
if gio == 7 or gio == 9 or gio == 11 or gio == 13 or gio == 15 then
if phut >= 55 and phut < 60 then
thoigian = 60 - phut
AddGlobalCountNews("V­ît ¶i ®ang trong giai ®o¹n b¸o danh, cßn "..thoigian.." phót n÷a sÏ b¾t ®Çu",1)
SetGlbMissionV(87,1)
end
elseif gio == 8 or gio == 10 or gio == 12 or gio == 14 or gio == 16 then
if phut == 0 then
AddGlobalCountNews("V­ît ¶i chÝnh thøc b¾t ®Çu, thêi gian cßn l¹i ®Ó qua ¶i lµ 30 phót",1)

SetGlbMissionV(87,2)
for i = 1,100 do
PlayerIndex = i
if (w == 25) then
Msg2Player("V­ît ¶i chÝnh thøc b¾t ®Çu, thêi gian cßn l¹i ®Ó qua ¶i lµ 30 phót")
SetFightState(1)
end
end
elseif phut == 30 then
AddGlobalCountNews("Ho¹t ®éng v­ît ¶i ®· kÕt thóc !!",1)
SetGlbMissionV(88,0)
SetGlbMissionV(89,0)
SetGlbMissionV(87,0)
end
end
end

function qua_huy_hoang()
qua1 = AddNPCEx(294,1,53,194,203, 3,9,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua2 = AddNPCEx(294,1,53,193,204, 7,2,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua3 = AddNPCEx(294,1,53,194,204, 5,5,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen
qua4 = AddNPCEx(294,1,53,194,203, 10,10,"\\script\\demhuyhoang\\quahuyhoang.lua",5) -- Map : Ba Lang Huyen

end

function hat_huy_hoang()
hat1 = AddNPCEx(295,1,53,194,203, 3,9,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat2 = AddNPCEx(295,1,53,193,204, 7,2,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat3 = AddNPCEx(295,1,53,194,204, 5,5,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen
hat4 = AddNPCEx(295,1,53,194,203, 10,10,"\\script\\demhuyhoang\\hathuyhoang.lua",5) -- Map : Ba Lang Huyen

end

function del_hat_hh()
DelNpc(hat1)
DelNpc(hat2)
DelNpc(hat3)
DelNpc(hat4)
end

function del_qua_hh()
DelNpc(qua1)
DelNpc(qua2)
DelNpc(qua3)
DelNpc(qua4)
end


function phonglangdo()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
if (gio == 7) or (gio == 19) then
if (phut >= 55) then
AddGlobalCountNews("ThuyÒn ®i Phong L¨ng §é s¾p khëi hµnh, nhanh ch©n ®Õn ThuyÒn Phu ®Ó ®¨ng ký",1)
end
elseif (gio == 8) or (gio == 20) then
if (phut >= 0) and (phut < 15) then
batdaupld()
elseif (phut == 15) then
denbopld()
end
end
end


function batdaupld()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
w,x,y = GetWorldPos()
phut1 = 15 - phut
for g=1,100 do
PlayerIndex = g
if (w == 45) then
SetFightState(1)
Msg2Player("ThuyÒn ®· rêi bÕn, cßn "..phut1.." phót n÷a sÏ cÊp bÕn Phong L¨ng §é")
end
end
end

function denbopld()
w,x,y = GetWorldPos()
for u=1,100 do
PlayerIndex = u
if (w == 45) then
NewWorld(46,1331,2861)
SetFightState(1)
Msg2Player("ThuyÒn ®· ®Õn bê B¾c Phong L¨ng §é")
end
end
end

keraotinh
21-06-12, 09:23 PM
Ko có ai biết nguyên nhân à :((

jxvietnam
21-06-12, 10:15 PM
Bạn đang dùng server nào ?

Nếu là awjx thì phải kích hoạt ở startup_remix.lua thì script nó mới chạy

keraotinh
21-06-12, 10:51 PM
Mình dùng server Công thành chiến mà 1 bác share gần đây nhất .

Đây là file starup_remix

Include("\\script\\global\\Get_NPC.lua")
Include("\\script\\source\\sourcejx49.lua")
Include("\\script\\Á½ºþÇø\\°ÍÁêÏØ\\npc\\luyenco ng.lua")
Include("\\script\\source\\timerserver.lua")
Include("\\dulieu\\quyensohuu.lua")
Include("\\script\\manager.lua")

server = 0
function khoidong()
w,x,y = GetWorldPos()
--if w == 53 then
if server == 0 then
SetGlbMissionV(27,1)
SetGlbMissionV(50,150)
print("")
print("| Server JX by Jxvietnam develop and edit |")
antihack()
npcallmaps()
server = 1
else
xaphu()
end
--else
--xaphu()
--end
end


function antihack()
curidx = SubWorld
idx = SubWorldID2Idx(1);
if idx == -1 then
Msg2Player("Kh«ng ThÓ Ch¹y Anti V× Map Ch­a Më !")
return
end
SubWorld = idx;
OpenMission(1);
StartMissionTimer(1,18,60*18);
end;

listgm={{"banhbao","Admin"}}

function admincheck()
for i=1,getn(listgm) do
if GetName() == listgm[i][1] then
if listgm[i][2] == "Admin" then
return 1
end
end
end
return 2
end


function main()
if admincheck() == 1 then
SayEx({"<color=cyan>Xa Phu:<color> Xin chµo ng­¬i muèn ®i ®©u nµo ?",
"Trë l¹i ®iÓm cò/backupdiadiem",
"Khu vùc thµnh thÞ/thanhthi",
"Khu vùc luyÖn c«ng/luyencong",
"Thay ®æi tr¹ng th¸i/doimau",
"§¶o tÈy tñy/daott",
"Chøc n¨ng Admin/WritePass",
"Tho¸t/Exit"})
elseif admincheck() == 2 then
SayEx({"<color=cyan>Xa Phu:<color> Xin chµo ng­¬i muèn ®i ®©u nµo ?",
"Trë l¹i ®iÓm cò/backupdiadiem",
"Khu vùc thµnh thÞ/thanhthi",
"Khu vùc luyÖn c«ng/luyencong",
"Thay ®æi tr¹ng th¸i/doimau",
"§¶o tÈy tñy/daott",
"Tho¸t/Exit"})
end
end

function doimau()
Say("PhÝ thay ®æi lµ 5000 l­îng 1 lÇn",6,
"LuyÖn c«ng/doimau1",
"ChÝnh ph¸i/doimau1",
"Tµ ph¸i /doimau1",
"Trung lËp /doimau1",
"S¸t thñ /doimau1",
"Tho¸t./no")
end

function doimau1(sel)
if GetCash() >= 5000 then
Pay(5000)
SetCamp(sel)
SetCurCamp(sel)
else
Talk(1,"","<color=red>Ng­¬i kh«ng cã 5000 l­îng !")
end
end


function daott()
if GetLevel() >= 50 then
if GetTask(52) == 0 then
Say("<color=blue>Xa Phu:<color> 1 nh©n vËt cÊp 50 ®­îc ®Õn <color=fire>®¶o tÈy tñy<color> miÔn phÝ <color=fire>1 lÇn,<color> ng­¬i sÏ ®i chø ?", 2,"§i ®¶o tu luyÖn/daottdimp","Tho¸t/no")
else
Say("<color=blue>Xa Phu:<color> §Ó tÈy tiÒm n¨ng cÇn 6 THBT<enter>§Ó tÈy kü n¨ng cÇn 3 lo¹i TT<enter>§Ó tÈy tiÒm n¨ng + kü n¨ng cÇn 3 TT, 6 THBT", 4,"TÈy kü n¨ng/daottdi","TÈy tiÒm n¨ng/daottdi","TÈy tiÒm n¨ng + kü n¨ng/daottdi","Tho¸t/no")
end
else
Talk(1,"","§¼ng cÊp thÊp h¬n 50, ko thÓ ®i ®¶o tÈy tñy")
end
end

function daottdimp()
SetTask(52,GetTask(52)+1)
MoveNPC(50,201,199,9,8,0,0);
SetTempRevPos(50,200*8*32,199*16*32)
Msg2Player("B¹n ®· ®Õn ®¶o luyÖn skill .....");
SetFightState(1)
SetRevPos(0)
SetLogoutRV(0)
end;

function daottdi(sel)
n = sel + 1
if n == 1 then
if (GetItemCount(28) >= 1) and (GetItemCount(29) >= 1) and (GetItemCount(30) >= 1) then
DelItem(28)
DelItem(29)
DelItem(30)
SetTask(52,2)
MoveNPC(50,201,199,9,8,0,0);
SetTempRevPos(50,200*8*32,199*16*32)
Msg2Player("B¹n ®· ®Õn ®¶o tÈy tñyl .....");
SetFightState(1)
SetRevPos(0)
SetLogoutRV(0)
else
Talk(1,"no","C¸c h¹ kh«ng cã ®ñ <color=red>Tö Thñy Tinh, Lam Thñy Tinh, Lôc Thñy Tinh<color>")
end
elseif n == 2 then
if GetItemCount(31) >= 6 then
SetTask(52,3)
for i=1,6 do DelItem(31) end
MoveNPC(50,201,199,9,8,0,0);
SetTempRevPos(50,200*8*32,199*16*32)
Msg2Player("B¹n ®· ®Õn ®¶o tÈy tñyl .....");
SetFightState(1)
SetRevPos(0)
SetLogoutRV(0)
else
Talk(1,"no","C¸c h¹ kh«ng cã ®ñ <color=red>6 TÝnh Hång B¶o Th¹ch<color>")
end
elseif n == 3 then
if (GetItemCount(28) >= 1) and (GetItemCount(29) >= 1) and (GetItemCount(30) >= 1) and (GetItemCount(31) >= 6) then
DelItem(28)
DelItem(29)
DelItem(30)
SetTask(52,4)
for i=1,6 do DelItem(31) end
MoveNPC(50,201,199,9,8,0,0);
SetTempRevPos(50,200*8*32,199*16*32)
Msg2Player("B¹n ®· ®Õn ®¶o tÈy tñy .....");
SetFightState(1)
SetRevPos(0)
SetLogoutRV(0)
else
Talk(1,"no","C¸c h¹ kh«ng cã ®ñ <color=red>3 lo¹i thñy tinh vµ 6 TÝnh Hång B¶o Th¹ch<color>")
end
end
end
function backupdiadiem()
ReturnFromPortal()
end

function thanhthi()
w,x,y = GetWorldPos()
if w == 53 then
SayEx({"<color=cyan>Xa Phu<color>: Ng­¬i muèn ®i ®©u ?","T­¬ng D­¬ng/tuongduong","Nam Nh¹c TrÊn/namnhac","Tho¸t/no"})
elseif w == 37 then -- tuong duong
SayEx({"<color=cyan>Xa Phu<color>: Ng­¬i muèn ®i ®©u ?","Ph­îng T­êng/phuongtuong","Thµnh §«/thanhdo","Ba L¨ng HuyÖn/balang","Tho¸t/no"})
elseif w == 36 then -- phuong tuong
SayEx({"<color=cyan>Xa Phu<color>: Ng­¬i muèn ®i ®©u ?","T­¬ng D­¬ng/tuongduong","Thµnh §«/thanhdo","Tho¸t/no"})
elseif w == 40 then -- thanh do
SayEx({"<color=cyan>Xa Phu<color>: Ng­¬i muèn ®i ®©u ?","T­¬ng D­¬ng/tuongduong","Ph­îng T­êng/phuongtuong","Tho¸t/no"})
elseif w == 52 then -- nam nhac tran
SayEx({"<color=cyan>Xa Phu<color>: Ng­¬i muèn ®i ®©u ?","Ba L¨ng HuyÖn/balang","Tho¸t/no"})
else
SayEx({"<color=cyan>Xa Phu<color>: Ng­¬i muèn ®i ®©u ?","T­¬ng D­¬ng/tuongduong","Ph­îng T­êng/phuongtuong","Thµnh §«/thanhdo","Ba L¨ng HuyÖn/balang","Nam Nh¹c TrÊn/namnhac","Tho¸t/no"})
end
end


function tuongduong()
if GetCash() >= 500 then
post = random(0,3)
if post == 0 then
NewWorld(37,1589,3374)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn T­¬ng D­¬ng...")
SetRevPos(53,200*8,200*16)
elseif post == 1 then
NewWorld(37,1436,3216)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn T­¬ng D­¬ng...")
SetRevPos(53,200*8,200*16)
elseif post == 2 then
NewWorld(37,1507,3139)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn T­¬ng D­¬ng...")
SetRevPos(53,200*8,200*16)
elseif post == 3 then
NewWorld(37,1695,3236)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn T­¬ng D­¬ng...")
SetRevPos(53,200*8,200*16)
end
Pay(500)
SetFightState(1)
else
Talk(1,"","Kh«ng cã 500 l­îng")
end

end
function phuongtuong()
if GetCash() >= 500 then
post = random(0,3)
if post == 0 then
NewWorld(36,1644,3275)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Ph­îng T­êng...")
SetRevPos(53,200*8,200*16)
elseif post == 1 then
NewWorld(36,1522,3231)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Ph­îng T­êng...")
SetRevPos(53,200*8,200*16)
elseif post == 2 then
NewWorld(36,1560,3113)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Ph­îng T­êng...")
SetRevPos(53,200*8,200*16)
elseif post == 3 then
NewWorld(36,1652,3167)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Ph­îng T­êng...")
SetRevPos(53,200*8,200*16)
end
Pay(500)
else
Talk(1,"","Kh«ng cã 500 l­îng")
end
end
function duongchau()
post = random(0,3)
if post == 0 then
MoveNPC(39,209,187,0+random(-2,2),3+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn D­¬ng Ch©u...")
SetRevPos(53,200*8,200*16)
elseif post == 1 then
MoveNPC(39,199,200,5+random(-2,2),1+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn D­¬ng Ch©u...")
SetRevPos(53,200*8,200*16)
elseif post == 2 then
MoveNPC(39,215,200,5+random(-2,2),8+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn D­¬ng Ch©u...")
SetRevPos(53,200*8,200*16)
elseif post == 3 then
MoveNPC(39,229,191,3+random(-2,2),2+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn D­¬ng Ch©u...")
SetRevPos(53,200*8,200*16)
end
end
function thanhdo()
if GetCash() >= 500 then
post = random(0,3)
if post == 0 then
NewWorld(40,3194,5193)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Thµnh §«...")
SetRevPos(53,200*8,200*16)
elseif post == 1 then
NewWorld(40,3013,5097)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Thµnh §«...")
SetRevPos(53,200*8,200*16)
elseif post == 2 then
NewWorld(40,3024,4959)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Thµnh §«...")
SetRevPos(53,200*8,200*16)
elseif post == 3 then
NewWorld(40,3270,5001)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Thµnh §«...")
SetRevPos(53,200*8,200*16)
end
Pay(500)
else
Talk(1,"","Kh«ng cã 500 l­îng")
end
end
function bienkinh()

post = random(0,3)
if post == 0 then
MoveNPC(38,204,199,6+random(-2,2),0+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn BiÖn Kinh...")
SetRevPos(53,200*8,200*16)
elseif post == 1 then
MoveNPC(38,213,201,3+random(-2,2),8+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn BiÖn Kinh...")
SetRevPos(53,200*8,200*16)
elseif post == 2 then
MoveNPC(38,233,182,5+random(-2,2),8+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn BiÖn Kinh...")
SetRevPos(53,200*8,200*16)
elseif post == 3 then
MoveNPC(38,199,187,7+random(-2,2),6+random(-2,2),500,0);
SetRevPos(53,200*8,200*16)
Msg2Player("Ngåi yªn ! §ang ®i ®Õn BiÖn Kinh...")
end;
end
function balang()
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 ! §ang ®i ®Õn Ba L¨ng HuyÖn...")
end
function giangtan()
MoveNPC(25,432,382,3+random(-2,2),1+random(-2,2),500,0);
Msg2Player("Ngoi Yen ! Dang di den Giang Tan Thon...")
end
function namnhac()
MoveNPC(52,198,193,4+random(-2,2),8+random(-2,2),500,0);
Msg2Player("Ngåi yªn ! §ang ®i ®Õn Nam Nh¹c TrÊn...")
end


------------------------Fan PassWorld ADMIN thay doi tu do----
MATKHAU = {2,3,2,3,2,2}
function WritePass()
if GetTaskTemp(57) == 1 then
manager()
else
SayEx({"<color=red>HÖ thèng<color>: Xin mêi nhËp pass :",
"1./number",
"2./number",
"3./number",
"4./number",
"5./number",
"6./number",
"7,/number",
"8./number",
"9./number",
"0./number",
"Tho¸t./finish"})
end
end

function number(sel)
id = sel + 1
if id == 10 then
id = 0
end
if GetTaskTemp(55) == 0 then
if (id == MATKHAU[1]) then
SetTaskTemp(55,GetTaskTemp(55)+1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
else
SetTaskTemp(55,GetTaskTemp(55)+1)
SetTaskTemp(56,1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
end
elseif GetTaskTemp(55) == 1 then
if (id == MATKHAU[2]) then
SetTaskTemp(55,GetTaskTemp(55)+1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
else
SetTaskTemp(55,GetTaskTemp(55)+1)
SetTaskTemp(56,1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
end
elseif GetTaskTemp(55) == 2 then
if (id == MATKHAU[3]) then
SetTaskTemp(55,GetTaskTemp(55)+1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
else
SetTaskTemp(55,GetTaskTemp(55)+1)
SetTaskTemp(56,1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
end
elseif GetTaskTemp(55) == 3 then
if (id == MATKHAU[4]) then
SetTaskTemp(55,GetTaskTemp(55)+1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
else
SetTaskTemp(55,GetTaskTemp(55)+1)
SetTaskTemp(56,1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
end
elseif GetTaskTemp(55) == 4 then
if (id == MATKHAU[5]) then
SetTaskTemp(55,GetTaskTemp(55)+1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
else
SetTaskTemp(55,GetTaskTemp(55)+1)
SetTaskTemp(56,1)
WritePass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
end
elseif GetTaskTemp(55) == 5 then
if (id == MATKHAU[6]) then
SetTaskTemp(55,GetTaskTemp(55)+1)
Msg2Player("B¹n ®· nhËp sè "..id.."")
CheckPass()
else
SetTaskTemp(55,GetTaskTemp(55)+1)
SetTaskTemp(56,1)
CheckPass()
Msg2Player("B¹n ®· nhËp sè "..id.."")
end

end
end

function finish()
KickOutSelf()
end

function CheckPass()
if GetTaskTemp(56) >= 1 then
Talk(1,"finish","Admin Server:\nB¶o vÖ tÝnh n¨ng Admin rÊt quan träng !")
else
SetTaskTemp(55,0)
SetTaskTemp(57,1)
Msg2Player("Pass chÝnh x¸c, tÝnh n¨ng ®· më !")
manager()
end
end


P/S nếu ko nhầm thì avata bác sắp nói chữ "NGU" T^T