Forum

> > CS2D > Scripts > Guys,Help me,Is this right?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Guys,Help me,Is this right?

7 replies
To the start Previous 1 Next To the start

old Guys,Help me,Is this right?

Dovahkin
User Off Offline

Quote
addhook("serveraction", "saction")
addhook("menu", "mymenu")
function saction(id, sact)
if(sact==1) then
menu(id,"Secret Shop,Die")
end
end

addhook("menu","mymenu")
function mymenu(id,a,b)
if a=="Secret Shop" then
if b==1 then
menu(id,"Die,Gas Grenade/500$")
end
if b==1 and mon>500 then
parse("equip "..id.." 72")
parse("setmoney "..id.." "..player(id,"money")(mon-500))
elseif mon<item cost
msg("©000255255You don't have money to buy this")
end
end
end

old Re: Guys,Help me,Is this right?

Flacko
User Off Offline

Quote
Oh no, this is can't be right. First, you didn't put your code between the [ code] tags, second, you didn't use any kind of indentation, and third and worst of all, you didn't even try your script.
I repeat, this CAN'T be right.

old Re: Guys,Help me,Is this right?

EngiN33R
Moderator Off Offline

Quote
firetounge41 has written
elseif mon<item cost

It should be
1
elseif mon<500 then
You can't have whitespaces in variable names. And you have to put then after elseif.

old Re: Guys,Help me,Is this right?

Homam
User Off Offline

Quote
Try 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
addhook("serveraction","saction")
addhook("menu", "mymenu")
	function saction(id,sact)
		if sact==3 then
		menu(id,"Secret Shop,Die")
	end
end


function mymenu(id,a,b)
	if a=="Secret Shop" then
		if b==1 then
			menu(id,"Die,Gas Grenade/500$")
		end
	end
		if a=="Die" then
			if b==1 and player(id,"money") >= 499 then
			parse("setmoney "..id.." "..player(id,"money") - 500)
			parse("equip "..id.." 72")
		else
			msg2(id,"©000255255You don't have money to buy this")
		end
	end
end

Not tested, i Hope it worked..
edited 3×, last 22.03.11 05:45:59 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview