English Buy menu doesn't work at all.

2 replies
Goto Page
To the start Previous 1 Next To the start
18.06.13 12:43:34 am
Up
D-D3ADxPro
User
Offline Off
I tried to see other threads about this, but none of them helped me. Im using EP's buy menu script, which I edited.

Heres a full script:
Code:
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
--------------------------------
-- Sparta Script                  --
-- By D-D3ADxPro                  --
-- Thanks For Downloading! :) --
--------------------------------

------------------------------
-- Basic Functions                --
------------------------------

addhook("serveraction","spartabuymenu")
function spartabuymenu(id,act)
if act==3 then
menu(id,"Sparta Buy Menu,Swords,Tactical Shields,Armor,Others")
     end
end

addhook("menu","buymenu")
function buymenu(id,title,buton)
if title=="Sparta Buy Menu" then
if buton==1 then
menu(id,"Sparta Swords,Wooden Sword|$1000,Iron Sword|$3500,Fire Sword|$6500,Diamond Sword|$8500,Golden Sword|$12000")
elseif buton==2 then
menu(id,"Sparta Shields,Wooden Shield|$700,Iron Shield|$2500,Fire Shield|$4000,Diamond Shield|$7000,Poisonous Shield|$9500,Golden Shield|$12550")
elseif buton==3 then
menu(id,"Sparta Armor,65 AP|$250,100 AP|$700,Weak Armor|$2500,Normal Armor|$4550,Hard Armor|$6000,Extreme Armor|$12000")
elseif buton==4 then
menu(id,"Sparta Others,Snowballs|$1200,Sachel Charges|$2500,Stick Bombs|$3500,Crossbow|$4500")
end
end


In console it just shows this:
Code:
1
LUA ERROR: maps/cs_italy:30: 'end' expected (to close 'if' at line 20) near '<eof'>


I tried to change up things, but they don't work at all.
Revisiting after 4 years, and boy how much cs2d really changed.
18.06.13 12:52:54 am
Up
VADemon
User
Offline Off
Thats what happens when you dont put tabs. Add an "end" at the end
18.06.13 01:07:16 am
Up
limonata
User
Offline Off
Here: / And put tabs to your code lines. Like mine.

Code:
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
--------------------------------
-- Sparta Script                  --
-- By D-D3ADxPro                  --
-- Thanks For Downloading! :) --
--------------------------------

------------------------------
-- Basic Functions                --
------------------------------

addhook("serveraction","spartabuymenu")
function spartabuymenu(id,act)
     if act==3 then
          menu(id,"Sparta Buy Menu,Swords,Tactical Shields,Armor,Others")
    end
end

addhook("menu","buymenu")
function buymenu(id,title,buton)
     if title=="Sparta Buy Menu" then
          if buton==1 then
               menu(id,"Sparta Swords,Wooden Sword|$1000,Iron Sword|$3500,Fire Sword|$6500,Diamond Sword|$8500,Golden Sword|$12000")
          elseif buton==2 then
               menu(id,"Sparta Shields,Wooden Shield|$700,Iron Shield|$2500,Fire Shield|$4000,Diamond Shield|$7000,Poisonous Shield|$9500,Golden Shield|$12550")
          elseif buton==3 then
               menu(id,"Sparta Armor,65 AP|$250,100 AP|$700,Weak Armor|$2500,Normal Armor|$4550,Hard Armor|$6000,Extreme Armor|$12000")
          elseif buton==4 then
               menu(id,"Sparta Others,Snowballs|$1200,Sachel Charges|$2500,Stick Bombs|$3500,Crossbow|$4500")
          end
     end
end
To the start Previous 1 Next To the start