PtokaX forum

Development Section => Your Developing Problems => Topic started by: mandix on 02 June, 2004, 01:51:23

Title: Prob with menu(left mouse)
Post by: mandix on 02 June, 2004, 01:51:23
i am makeing a custom right click menu
but i got a error that i cant solve, can u help me ?!?

ANYONE, ?? plz ??

SendTo = {
[0] = 1,   -- Masters
[1] = 1,   -- Operators
[2] = 1,   -- Vips
[3] = 0,   -- Regs
[4] = 1,   -- Moderator
[5] = 1,   -- NetFounder
[-1] = 0,  -- Users
}

sMenu = "RC"

assert(dofile("tbl/checklevel.tbl"),"tbl/checklevel.tbl not found")

function OpConnected(user)
if (SendTo[user.iProfile]==1) then
GetRightClickComs(user)
customCMDs(user)
user:SendData("Enhanced Right Click Support is available!")
end
end

function NewUserConnected(user)
if (SendTo[user.iProfile]==1) then
GetRightClickComs(user)
customCMDs(user)
user:SendData("Enhanced Right Click Support is available!")
end
end

function GetRightClickComs(user)
TCopy={}
for cmd,_ in LevelCheck do
if LevelCheck[cmd][user.iProfile] == 1 then
for value,command in RightClick do
if cmd == value then
tinsert(TCopy,{value,command})
end end end end

sort(TCopy,function(a,b) return (a[1] < b[1]) end)
for t = 1, getn(TCopy) do
if TCopy[t] then user:SendData(TCopy[t][2])
end end TCopy={} collectgarbage() flush()
end

function customCMDs(user)

user:SendData("$UserCommand 1 3 User Commands\\FaQ$<%[mynick]> !faq||",
user:SendData("$UserCommand 1 3 User Commands\\Rules$<%[mynick]> !rules||",
user:SendData("$UserCommand 1 3 User Commands\\Network$<%[mynick]> !network||",
user:SendData("$UserCommand 1 3 User Commands\\Bandit\\Off$<%[mynick]> b.stop||",
user:SendData("$UserCommand 1 3 User Commands\\Bandit\\On$<%[mynick]> b.start||",
user:SendData("$UserCommand 1 3 User Commands\\My Info\\My IP$<%[mynick]> !myip||",
user:SendData("$UserCommand 1 3 User Commands\\My Info\\My Info$<%[mynick]> !myinfo||",
end      -- line 55

RightClick = { -- op commands here }



error :

Syntax error: expected;
  last token read: `end' at line 55 in string "SendTo = {
..."
Title:
Post by: VidFamne on 02 June, 2004, 02:00:16
You've forgotten to close the parenthesis with this ")"
Title:
Post by: bastya_elvtars on 02 June, 2004, 02:01:27
Same error here.
Title:
Post by: Herodes on 02 June, 2004, 02:34:01
mandix it's there already man (http://board.univ-angers.fr/thread.php?threadid=2102&boardid=9&styleid=1) ... Don't double post ...
keep it simple ... You 'll get your answers most of the times ..