Forum

> > CS2D > Scripts > Pls little fix!
Forums overviewCS2D overview Scripts overviewLog in to reply

English Pls little fix!

9 replies
To the start Previous 1 Next To the start

old Pls little fix!

Suprise
BANNED Off Offline

Quote
Hello scripters there! I have a fastbuild&Unlimited build script. But I have a problem with it! When I create Turret or some building type then it doesn't take -5000 money from my cash! I hope you will fix it!

1
2
3
4
5
6
7
8
addhook("buildattempt","FUBuild")

function FUBuild(p,t,x,y,i)
 if t==20 or t==21 then
 end
 parse('spawnobject '..t..' '..x..' '..y..' 0 0 '..player(p,"team")..' '..p)
 return 1
end

Thx in advance!

old Re: Pls little fix!

Alistaire
User Off Offline

Quote
1
2
3
4
5
if player(p, 'money') >= 5000 then
	parse('setmoney '..p..' '..player(p, 'money') - 5000)
else
	msg2(p, 'You don't have enough money')
end

old Re: Pls little fix!

Suprise
BANNED Off Offline

Quote
user ohaz has written
user Suprise has written
if t==20 or t==21 then
end
Why do these two lines even exist?


Dont know! The creator wrote this


user Alistaire has written
1
2
3
4
5
if player(p, 'money') >= 5000 then
	parse('setmoney '..p..' '..player(p, 'money') - 5000)
else
	msg2(p, 'You don't have enough money')
end

Doesnt work

old Re: Pls little fix!

MikuAuahDark
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
addhook("buildattempt","FUBuild")
function FUBuild(p,t,x,y,i)
	if player(p, 'money') >= 5000 then
		parse('setmoney '..p..' '..player(p, 'money') - 5000)
		parse('spawnobject '..t..' '..x..' '..y..' 0 0 '..player(p,"team")..' '..p)
		return 1
	else
		msg2(p, 'You don't have enough money')
	end
end

old Re: Pls little fix!

Suprise
BANNED Off Offline

Quote
user MikuAuahDark has written
1
2
3
4
5
6
7
8
9
10
addhook("buildattempt","FUBuild")
function FUBuild(p,t,x,y,i)
	if player(p, 'money') >= 5000 then
		parse('setmoney '..p..' '..player(p, 'money') - 5000)
		parse('spawnobject '..t..' '..x..' '..y..' 0 0 '..player(p,"team")..' '..p)
		return 1
	else
		msg2(p, 'You don't have enough money')
	end
end


Thanks!

old Re: Pls little fix!

EngiN33R
Moderator Off Offline

Quote
user MikuAuahDark's code will do it so that if you don't have enough money you could still build the thing if it costs less or equal to 5000. Add a return 1 after the Not enough money message.

old Re: Pls little fix!

Suprise
BANNED Off Offline

Quote
user EngiN33R has written
user MikuAuahDark's code will do it so that if you don't have enough money you could still build the thing if it costs less or equal to 5000. Add a return 1 after the Not enough money message.


unnecessary! Its work without return 1!

IMG:https://i40.servimg.com/u/f40/17/30/54/57/asd10.jpg

old Re: Pls little fix!

EngiN33R
Moderator Off Offline

Quote
Well with that script, if you try to build a barricade you'll get a message about 'not enough money' and still build one, you know.

old Re: Pls little fix!

Suprise
BANNED Off Offline

Quote
user EngiN33R has written
Well with that script, if you try to build a barricade you'll get a message about 'not enough money' and still build one, you know.


Oh! Then sorry!
EDIT: But then How to Fix this problem?
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview