Forum

> > CS2D > Scripts > Can you fix this script?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Can you fix this script?

20 replies
Page
To the start Previous 1 2 Next To the start

old Can you fix this script?

Mami Tomoe
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
if men == "Buy" then
		if sel == 1 then
		if rp_money => 100000 then
			if rp_license[id] == 0 then
			rp_money[id]= rp_money[id]- license_price
			rp_license[id] = 1
			gmsg2(id,"000255000","You have bought a license!")
			else
			gmsg2(id,"255000000","You already have a license!")
			else
			gmsg2(id,"255000000","Not enough money!")
			end
			end

This code doesn't work...
I tried many things but it just gives errors like
then expected
end expected
etc...

Can you help me please?

old Re: Can you fix this script?

Yates
Reviewer Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if men == "Buy" then
	if sel == 1 then
		if rp_money => 100000 then
			if rp_license[id] == 0 then
				rp_money[id]= rp_money[id]- license_price
				rp_license[id] = 1
				gmsg2(id,"000255000","You have bought a license!")
			else
				gmsg2(id,"255000000","You already have a license!")
			end
		else
			gmsg2(id,"255000000","Not enough money!")
		end
	end
end

old Re: Can you fix this script?

RedizGaming
GAME BANNED Off Offline

Quote
@user Mami Tomoe:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if men == "Buy" then
     if sel == 1 then
          if rp_money[id] => 100000 then -- only need add [id] :ugly: 
               if rp_license[id] == 0 then
                    rp_money[id]= rp_money[id]- license_price
                    rp_license[id] = 1
                    gmsg2(id,"000255000","You have bought a license!")
               else
                    gmsg2(id,"255000000","You already have a license!")
               end
          else
               gmsg2(id,"255000000","Not enough money!")
          end
     end
end

old Re: Can you fix this script?

Mami Tomoe
User Off Offline

Quote
@user THEMUD:
This is the hooks.lua file:
http://www.mediafire.com/download/y3ngc15brvvrra3/hooks.lua

I need to fix the:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if men == "Buy" then
     if sel == 1 then
          if rp_money[id] => 100000 then
               if rp_license[id] == 0 then
                    rp_money[id]= rp_money[id]- license_price
                    rp_license[id] = 1
                    gmsg2(id,"000255000","You have bought a license!")
               else
                    gmsg2(id,"255000000","You already have a license!")
               end
          else
               gmsg2(id,"255000000","Not enough money!")
          end
     end
end

Line number 822 is:
1
if rp_money[id] => 100000 then

old Re: Can you fix this script?

RedizGaming
GAME BANNED Off Offline

Quote
@user Mami Tomoe:

try to use it

1
2
3
4
5
6
7
8
9
10
11
12
13
14
if men == "Buy" then
	if sel == 1 then
		if rp_money[id] >= 100000 then
			if rp_license[id] == 0 then
				rp_money[id] = rp_money[id] - 100000
				rp_license[id] = 1
				gmsg2(id,"000255000","You have bought a license!")
			else
				gmsg2(id,"255000255","You already have a license!")
			end
		else
			gmsg2(id,"255000255","Not enough money!")
		end
	end

--------------------------------

1
2
3
4
5
6
7
8
9
10
11
12
13
14
if men == "Buy" then
	if sel == 1 then
		if rp_money[id] => 100000 then
			if rp_license[id] == 0 then
				rp_money[id] = rp_money[id] - 100000
				rp_license[id] = 1
				gmsg2(id,"000255000"," You have bought a license!")
			else
				gmsg2(id,"255000000"," You already have a license!")
			end
		else
			gmsg2(id,"255000000"," Not enough money!")
		end
	end

old Re: Can you fix this script?

Mami Tomoe
User Off Offline

Quote
@user THEMUD:
1
LUA ERROR: sys/lua/IF/sys/hooks.lua:895: 'end' expected (to close 'function' at line 388) near 'elseif'

@user RedizGaming:
Code 1:
1
LUA ERROR: sys/lua/IF/sys/hooks.lua:1051: '<eof>' expected near 'end'
Code 2:
1
LUA ERROR: sys/lua/IF/sys/hooks.lua:882: 'then' expected near '='

old Re: Can you fix this script?

RedizGaming
GAME BANNED Off Offline

Quote
@user Mami Tomoe:

1
2
3
4
5
6
7
8
9
10
11
12
13
if men == "Buy" then
	if sel == 1 then
		if rp_money[id] => 100000 then
			if rp_license[id] == 0 then
				rp_money[id] = rp_money[id] - 100000
				rp_license[id] = 1
				msg2(id,"©000255000 You have bought a license!")
			else
				msg2(id,"©255000000 You already have a license!")
			end
		else
			msg2(id,"©255000000 Not enough money!")
		end
try with this

old Re: Can you fix this script?

RedizGaming
GAME BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
if men == "Buy" then
     if sel == 1 then
          if rp_money[id] >= 100000 then
               if rp_license[id] == 0 then
                    rp_money[id] = rp_money[id] - 100000
                    rp_license[id] = 1
                    gmsg2(id,"000255000","You have bought a license!")
               else
                    gmsg2(id,"255000255","You already have a license!")
               end
          else
               gmsg2(id,"255000255","Not enough money!")
          end

Sorry try with this
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview