Forum

> > CS2D > Scripts > Function request (items)
Forums overviewCS2D overview Scripts overviewLog in to reply

English Function request (items)

3 replies
To the start Previous 1 Next To the start

old Function request (items)

Mami Tomoe
User Off Offline

Quote
Hi I need a function to do the following:
> INPUT: id
< OUTPUT: true / false

Take the ID of the player and check it's X,Y and then check how many items (in numbers) are there under him, if there are more than 50 then return false, otherwise return true.

Is it possible please

Thanks

old Re: Function request (items)

Waldin
User Off Offline

Quote
Try with this
1
2
3
4
function myFunc(id)
	if #closeitems(id,0) > 50 then return false end
	return true
end
edited 2×, last 17.07.16 09:43:55 pm

old Re: Function request (items)

TrialAndError
User Off Offline

Quote
1
2
3
4
5
6
function was(id)
	if #closeitems(id,0)< 50 then
		return true
	end
	return false
end

Tested and worked.

Waldin's also work. Pretty much exactly same thing

old Re: Function request (items)

Mami Tomoe
User Off Offline

Quote
1
2
3
4
5
6
7
function was(id)
	if #closeitems(id,0)>=50 then
		return true
	else
		return false
	end
end

Is the code I use, and what it does:
If there are more than or exactly 50 items it will return true, if there are less than 50 then it will return false.

(This is for whoever want's to use it too)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview