PDA

View Full Version : Anh em xem hộ file này..



mr_panda1308
26-11-11, 12:42 AM
Mình đang xài sv TSBD 0.3 + awjx của Edward, vì muốn thêm 1 vài chức năng nên mình đã chỉnh lại file npc_xephang.lua ở trong folder Global trong sv, và khi chạy gameserver.exe thì nó báo lỗi này:

error: 'then' expected;
last token read: 'f' at line 114 in string "?"
còn đâu ở dưới nó vẫn success 5 dòng bt
đoạn code mình edit đây:

---Author:Ohishu----Date: 07/08/2010


Include("\\script\\source\\sourcejx49.lua")
Include("\\dulieu\\listxephang.lua")
Include("\\script\\GetFaction.lua")


function main()
SayEx({"<color=cyan>HÖ thèng:<color> Chµo mõng b¹n ®Õn víi <color=red>Vâ L©m TruyÒn Kú ",
"Hç trî t©n thñ/trogiuptt",
"NhËn vò khÝ train/vukhi",
"NhËn bÝ kÝp 9x/bikip",
"LÊy phóc duyªn lé/lpdl",
"LÊy Tinh hång b¶o th¹ch/lthbt",
"NhËn danh hiÖu/ndhh",
"CËp nhËt th«ng tin/capnhat",
"Xem b¶ng xÕp h¹ng/xephang",
"Tho¸t/Exit"})
end


function ndhh()
if GetLevel() < 190 then
while GetLevel() >= 190 do setrank() end
SayEx({"<color=yellow>NhËn danh hiÖu ",
"Administrator /rankadmin",
"Thiªn H¹ §Ö NhÊt /thdn",
"V« Song V­¬ng Gi¶ /vsvg",
"§Ñp Trai NhÊt Xãm /dtnx",
"T«i Lµ Gay /tlg",
"Bùa Kh«ng §ì Næi /bkdn",
"Nh×n G× Tao /ngt",
"Tæ §éi Chã §µn /tdcd",
"B¹n Cña Admin /bcad",
"D©n Ch¬i C­ìi Ngùa /dccn",
"Tho¸t/Exit"})
else
Msg2Player("Level cña b¹n ch­a ®¹t ®Õn cÊp 190 trë lªn")
end
end

function rankadmin()
SetRank(34)
Msg2Player("B¹n nhËn ®­îc danh hiÖu Administrator ")
end;


function thdn()
SetRank(33)
Msg2Player("B¹n nhËn ®­îc danh hiÖu Thiªn H¹ §Ö NhÊt ")
end;


function vsvg()
SetRank(41)
Msg2Player("B¹n nhËn ®­îc danh hiÖu V« Song V­¬ng Gi¶ ")
end;


function dtnx()
SetRank(241)
Msg2Player("B¹n nhËn ®­îc danh hiÖu §Ñp Trai NhÊt Xãm ")
end;


function tlg()
SetRank(242)
Msg2Player("B¹n nhËn ®­îc danh hiÖu T«i Lµ Gay ")
end;


function bkdn()
SetRank(243)
Msg2Player("B¹n nhËn ®­îc danh hiÖu Bùa Kh«ng §ì Næi ")
end;


function ngt()
SetRank(244)
Msg2Player("B¹n nhËn ®­îc danh hiÖu Nh×n G× Tao ")
end;


function tdcd()
SetRank(245)
Msg2Player("B¹n nhËn ®­îc danh hiÖu Tæ §éi Chã §µn ")
end;


function bcad()
SetRank(246)
Msg2Player("B¹n nhËn ®­îc danh hiÖu B¹n Cña Admin ")
end;


function dccn()
SetRank(247)
Msg2Player("B¹n nhËn ®­îc danh hiÖu D©n Ch¬i C­ìi Ngùa ")
end;

function trogiuptt()
if GetLevel() < 6 then
while GetLevel() < 90 do AddOwnExp(9999999) end
AddEventItem(132)
AddItem(0,4,12,1,1,10,10)
AddItem(0,6,25,1,1,10,10)
AddItem(0,5,22,1,1,10,10)
AddItem(0,9,15,1,1,10,10)
AddItem(0,3,25,1,1,10,10)
AddItem(0,8,19,1,1,10,10)
AddItem(0,2,46,1,1,10,10)
AddItem(0,7,38,1,1,10,10)
AddItem(0,3,25,2,1,10,10)
AddItem(0,10,2,10,0,0,0)
Earn(500000)
else
Msg2Player("B¹n kh«ng ph¶i lµ t©n thñ level < 6")
end
end


function vukhi()
if GetTask(149) == 0 then
Say("Xin mêi chän vò khÝ sö dông?",7,"KiÕm/vk","§ao/vk","Bæng/vk","Th­¬ng/vk","Chïy/vk","Song ®ao/vk","Thãat/no")
else
Talk(1,"","Ng­¬i ®· nhËn vò khÝ hç trî råi!")
end
end


function vk(sel)
n = sel + 1
if n >= 1 and n <=6 then
AddItem(0,0,20,n,1,10,10)
SetTask(149,1)
else
end
end


function lpdl()
AddEventItem(106)
AddEventItem(106)
AddEventItem(106)
AddEventItem(106)
AddEventItem(106)


Msg2Player("B¹n NhËn §­îc 5 lä Phóc duyªn lé (TiÓu)")
end


function lthbt()
AddEventItem(31)
AddEventItem(31)
AddEventItem(31)
AddEventItem(31)
AddEventItem(31)


Msg2Player("B¹n NhËn §­îc 5 viªn Tinh hång b¶o th¹ch")
end


function setrank()
SayEx({"<color=yellow>NhËn danh hiÖu ",
"Administrator /rankadmin",
"Thiªn H¹ §Ö NhÊt /thdn",
"V« Song V­¬ng Gi¶ /vsvg",
"§Ñp Trai NhÊt Xãm /dtnx",
"T«i Lµ Gay /tlg",
"Bùa Kh«ng §ì Næi /bkdn",
"Nh×n G× Tao /ngt",
"Tæ §éi Chã §µn /tdcd",
"B¹n Cña Admin /bcad",
"D©n Ch¬i C­ìi Ngùa /dccn",
"Tho¸t/Exit"})
end;


function bikip()
if GetTask(148) == 0 then
if kiemtraft() == 1 then
Say("",4,"ThiÕu L©m quyÒn/tl","ThiÕu L©m ®ao/tl","ThiÕu L©m bæng/tl","Tho¸t/no")
elseif kiemtraft() == 2 then
Say("",4,"Thiªn V­¬ng th­¬ng/tv","Thiªn V­¬ng chuú/tv","Thiªn V­¬ng ®ao/tv","Tho¸t/no")
elseif kiemtraft() == 3 then
Say("",5,"§­êng M«n tô tiÔn/dm","§­êng M«n phi ®ao/dm","§­êng M«n phi tiªu/dm","§­êng M«n bÉy/dm","Tho¸t/no")
elseif kiemtraft() == 4 then
Say("",4,"Ngò §éc ch­ëng/nd","Ngò §éc ®ao/nd","Ngò §éc bïa/nd","Tho¸t/no")
elseif kiemtraft() == 5 then
Say("",4,"Nga My ch­ëng/nm","Nga My kiÕm/nm","Nga My buff/nm","Tho¸t/no")
elseif kiemtraft() == 6 then
Say("",3,"Thuý Yªn ®ao/ty","Thuý Yªn song ®ao/ty","Tho¸t/no")
elseif kiemtraft() == 7 then
Say("",3,"C¸i Bang ch­ëng/cb","C¸i Bang bæng/cb","Tho¸t/no")
elseif kiemtraft() == 8 then
Say("",4,"Thiªn Nh·n ®ao/tn","Thiªn Nh·n th­¬ng/tn","Thiªn Nh·n bïa/tn","Tho¸t/no")
elseif kiemtraft() == 9 then
Say("",3,"Vâ §ang khÝ/vd","Vâ §ang kiÕm/vd","Tho¸t/no")
elseif kiemtraft() == 10 then
Say("",4,"C«n L«n kiÕm/cl","C«n L«n ®ao/cl","C«n L«n bïa/cl","Tho¸t")
else
Talk(1,"","B¹n ch­a gia nhËp m«n ph¸i")
end
else
Talk(1,"","B¹n ®· nhËn kü n¨ng 90 råi")
end
end


function tl(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(74+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp ThiÕu L©m")
end


function tv(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(77+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp Thiªn V­¬ng")
end


function dm(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(80+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp §­êng M«n")
end


function nd(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(84+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp Ngò §éc")
end


function nm(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(87+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp nga my")
end


function ty(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(90+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp Thóy Yªn")
end


function cb(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(92+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp C¸i Bang")
end


function tn(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(94+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp Thiªn NhÉn")
end


function vd(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(97+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp Vâ §ang")
end


function cl(sel)
n = sel + 1
SetTask(148,1)
AddEventItem(99+n)
Msg2Player("B¹n ®· nhËn ®­îc bÝ kÝp C«n L«n")
end






function capnhat()
solanlap = getn(danhsachxephang)
vitri = 0


for i=1,solanlap do
if (GetUUID() == danhsachxephang[i][7]) then
vitri = i
end
end


if vitri == 0 then
t = (GetLevel() + GetTask(197) * 200) * 10000000000 + GetExp()
danhsachxephang[getn(danhsachxephang)+1] = {GetName(),GetLevel(),GetTask(197),GetRepute(),Get Task(162),t,GetUUID()} --Th«ng tin
danhsach = TaoBang(danhsachxephang,"danhsachxephang","")
SaveData("dulieu/listxephang.lua",danhsach)
Msg2Player("Th«ng tin nh©n vËt: "..GetName().." §· ®­îc Luu Vao Database !")
else
cs = GetTask(197)
t = (GetLevel() + GetTask(197) * 200) * 10000000000 + GetExp()
dv = GetRepute()
lv = GetLevel()
pd = GetTask(162)
danhsach = TaoBang(danhsachxephang,"danhsachxephang","")
danhsachxephang[vitri][2] = lv
danhsachxephang[vitri][3] = cs
danhsachxephang[vitri][4] = dv
danhsachxephang[vitri][5] = pd
danhsachxephang[vitri][6] = t
SaveData("dulieu/listxephang.lua",danhsach)
Msg2Player("Th«ng tin nh©n vËt: "..GetName().." §· cËp nhËt Lai !")
end
end


function xephang()
SayEx({"<color=cyan>HÖ thèng:<color> Ng­¬i muèn xem?",
"Top 10 Server/top10",
"Thu Hang b¶n th©n/hangbanthan",
"Tho¸t/Exit"})
end


function hangbanthan()
SayEx({"<color=cyan>HÖ thèng:<color> Ng­¬i muèn xem?",
"TØ lÖ phóc duyªn danh väng/tilebanthan",
"XÕp h¹ng b¶n th©n/xephangbanthan",
"Tho¸t/Exit"})
end


function tilebanthan()
dv = GetRepute()
pd = GetTask(162)
if dv + pd == 0 then
tile = 0
else
tile = floor(pd*100/(dv+pd))
end
Say("<color=yellow>"..GetName()..":<color>phóc duyªn :"..GetTask(162).." danh väng "..GetRepute().." TØ lÖ: "..tile.."% ",0)
end


function xephangbanthan()


solanlap = getn(danhsachxephang)
vt = 0


for i=1,solanlap do
if GetUUID() == danhsachxephang[i][7] then
vt = i
t = (GetLevel() + GetTask(197) * 200) * 10000000000 + GetExp()
dv = danhsachxephang[i][4]
end
end
if (vt ~= 0) then
xhdc = 1
xhdv = 1


for i=1,solanlap do
if t < danhsachxephang[i][6] then
xhdc = xhdc + 1
end
end


for i=1,solanlap do
if dv < danhsachxephang[i][4] then
xhdv = xhdv + 1
end
end


Say("<color=blue>HÖ thèng:<color> C¸c h¹ hiÖn giê xÕp <color=fire>hang "..xhdc..",<color> vÒ tu luyÖn vµ <color=fire> hang "..xhdv.."<color> vÒ danh väng",1,"Tho¸t/Exit")






else
Talk(1,"no","C¸c h¹ ch­a nhËp cÊp <color=red>d÷ liÖu nh©n vËt,<color> kh«ng cã h¹ng")
end


end


function top10()
bangxephang = {}
for i=1,10 do
danhsach2 = {}
danhsach1 = {}
danhsach = {}
solancs = 0
level = 0
pd = 0
dv = 0
TiLe_lonnhat = 0
----So Sanh Sè lÇn CS
for i=1,getn(danhsachxephang) do
if danhsachxephang[i][3] >= solancs and TimkiÕm(bangxephang,danhsachxephang[i][1]) == nil then
danhsach = {danhsachxephang[i][1]}
solancs = danhsachxephang[i][3]
elseif danhsachxephang[i][3] == solancs and TimkiÕm(bangxephang,danhsachxephang[i][1]) == nil then
danhsach[getn(danhsach)+1] = danhsachxephang[i][1]
end
end
--- So Sanh TØ lÖ phóc duyªn danh väng
for i = 1,getn(danhsach) do
if TiLe(danhsach[i],0) > TiLe_lonnhat and TimkiÕm(bangxephang,danhsach[i]) == nil then
danhsach1 = {danhsach[i]}
TiLe_lonnhat = TiLe(danhsach[i],0)
elseif TiLe(danhsach[i],0) == TiLe_lonnhat and TimkiÕm(bangxephang,danhsach[i]) == nil then
danhsach1[getn(danhsach1)+1] = danhsach[i]
end
end
---So Sanh Level
danhsach2 = {danhsach1[1]}
for i = 1,getn(danhsach1)-1 do
if LevelXepHang(danhsach1[i]) < level and TimkiÕm(bangxephang,danhsach1[i]) == nil then
danhsach2 = {danhsach1[i+1][1]}
level = LevelXepHang(danhsach1[i])
elseif LevelXepHang(danhsach1[i]) == level and TimkiÕm(bangxephang,danhsach1[i]) == nil then
danhsach2[getn(danhsach2)+1] = danhsach1[i+1][1]
end
end
if danhsach2[1] ~= nil then
bangxephang[getn(bangxephang)+1] = danhsach2
end
end
if getn(bangxephang) == 0 then
return
end


for i = 1,getn(bangxephang) do
for k = 1,getn(bangxephang[i]) do
str = "<<"..bangxephang[i][k]..">>\nSè lÇn chïyen Sinh: "..SoLanCS(bangxephang[i][k]).."\nTØ lÖ phóc duyªn danh väng: "..TiLe(bangxephang[i][k],1).."."
end
str = "Hang "..i..":\n"..str
Msg2Player(str)
str = ""
end
end












-------------------------------------------HAM HO TRO TO ALL-----------------------------------------------
function TimkiÕm(tenbang,tukhoa)
if getn(tenbang) == 0 then
return nil
end
for i= 1,getn(tenbang) do
for k = 1,getn(tenbang[i]) do
if tenbang[i][k] == tukhoa then
return 1
end
end
end
end
--------------------------------------------------------------------------------------------------------------


function SoLanCS(tennhanvat)
for i = 1,getn(danhsachxephang) do
if danhsachxephang[i][1] == tennhanvat then
return danhsachxephang[i][3]
end
end
end


function TiLe(tennhanvat,lamtron) --- TØ lÖ phóc duyªn danh väng
if tennhanvat == "" or tennhanvat == "Khong Xac Dinh" then
return 0
end
for i = 1,getn(danhsachxephang) do
if danhsachxephang[i][1] == tennhanvat then
if danhsachxephang[i][4]+danhsachxephang[i][5] == 0 then
return 0
else
if lamtron == 1 then
return floor(danhsachxephang[i][5]*100/(danhsachxephang[i][5]+danhsachxephang[i][4]))
else
return danhsachxephang[i][5]*100/(danhsachxephang[i][5]+danhsachxephang[i][4])
end
end
end
end
end


function LevelXepHang(tennhanvat)
for i = 1,getn(danhsachxephang) do
if danhsachxephang[i][1] == tennhanvat then
return danhsachxephang[i][2]
end
end
return "biet chet lien"
end






function no()
end


function Exit()
end


function noophuocthinh()
end
Mong anh em chỉ giáo!