Forum

> > CS2D > Scripts > Shop script area
Forums overviewCS2D overview Scripts overviewLog in to reply

English Shop script area

1 reply
To the start Previous 1 Next To the start

old Shop script area

maninja
User Off Offline

Quote
Hello guys

Welcome again I need something I will explain now
Explain stage : You know what i mean When you read title,
I need to lua shop x and y not function prees , i want area of that , if you go to that position just you need prees ~E~ and will get hud image of that ,

I think you understood what I meant in this case if someone help me, thank you very much for that

old Re: Shop script area

Bowlinghead
User Off Offline

Quote
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
-- untested
-- "Shop script area"
shopCenterTileX = 5
shopCenterTileY = 5
shopCenterTileRadius = 3

function isInShop(tx,ty) -- "I need to lua shop x and y not function prees"
	local dx = tx - shopCenterTileX
	local dy = ty - shopCenterTileY
	if (math.sqrt(dx*dx + dy*dy) <= shopCenterTileRadius) then
		return true
	else
		return false
	end
end


-- "Welcome again I need something I will explain now "
addhook("use", "maney")
function maney(id)
	if (isInShop(player(id,"tilex"),player(id,"tiley")) then
		-- msg2(id,"You entered the shop") just debug lol
		menu(id,"Kill Yourself, Yes, No") -- You know what i mean When you read title
		parse("hudtxt 13 'That' 200 200") -- "and will get hud image of that" 
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview