Forum

> > CS2D > Scripts > fix menu lua
Forums overviewCS2D overview Scripts overviewLog in to reply

English fix menu lua

No replies
To the start Previous 1 Next To the start

old fix menu lua

princeofpersia
User Off Offline

Quote
hi guys . i want make a function that when i use that open player list for me and give target player id to me .

same as this :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
target=0
addhook("menu","_list")
function list(id,title,buton)
menu(id,"Player List 1,"..exist(1).."|1,"..exist(2).."|2,"..exist(3).."|3,"..exist(4).."|4,"..exist(5).."|5,"..exist(6).."|6,"..exist(7).."|7,"..exist(8).."|8,Next")
if title=="Player List 1" then
if buton==9 then
menu(id,"Player List 2,"..exist(9).."|9,"..exist(10).."|10,"..exist(11).."|11,"..exist(12).."|12,"..exist(13).."|13,"..exist(14).."|14,"..exist(15).."|15,"..exist(16).."|16,Next")
    elseif buton~=0 then
        target=buton
end
elseif title=="Player List 2" then
    if buton==9 then
         menu(id,"Player List 3,"..exist(17).."|17,"..exist(18).."|18,"..exist(19).."|19,"..exist(20).."|20,"..exist(21).."|21,"..exist(22).."|22,"..exist(23).."|23,"..exist(24).."|24,Next")
    elseif buton~=0 then
         target=buton+8
end
elseif title=="Player List 3" then
    if buton==9 then
        menu(id,"Player List 4,"..exist(25).."|25,"..exist(26).."|26,"..exist(27).."|27,"..exist(28).."|28,"..exist(29).."|29,"..exist(30).."|30,"..exist(31).."|31,"..exist(32).."|32,Back")
          elseif buton~=0 then
               target=buton+16
          end
elseif title=="Player List 4" then
	         menu(id,"Player List 1,"..exist(1).."|1,"..exist(2).."|2,"..exist(3).."|3,"..exist(4).."|4,"..exist(5).."|5,"..exist(6).."|6,"..exist(7).."|7,"..exist(8).."|8,Next")
          if buton~=0 then
               target=buton+24
end
end
end
function exist(param)
     if player(param,"exists") then
          return player(param,"name")
     else
          return ""
     end
end

addhook("say","_say")
function _say(id,txt)
if txt=="!menu" then
kick(id)
return 1
end
end
function kick(id)
list(id)
parse("kick "..target)
end

with this code when i say !menu player list will open but didnt kick choosen player and i saw an eror > target is a table value. pls help me to fix it
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview