Forum

> > CS2D > Scripts > is gas mask an armour or an weapon type?
Forums overviewCS2D overview Scripts overviewLog in to reply

English is gas mask an armour or an weapon type?

8 replies
To the start Previous 1 Next To the start

old closed is gas mask an armour or an weapon type?

robed
User Off Offline

Quote
is gas mask an armour?
im trying to make a script
but i dont know that id is it when it comes to armour?
(id,"armor")==

if its not an armour
is it a weapons?
well if it is!
is should be like this
(id,"weapontype")==60

old Re: is gas mask an armour or an weapon type?

DC
Admin Off Offline

Quote
It is no armor. It behaves like the night vision or the defusekit. It's a slotless equipment item.

Unfortunately I forgot to add the right functionality to the cs2d lua cmd player command. Otherwise you would be able to use it to detect if a player has a gas mask or not. I'll add this for the next release.
edited 1×, last 30.06.12 05:21:32 pm

old Re: is gas mask an armour or an weapon type?

robed
User Off Offline

Quote
thanks

now i can make a heal system with it

addhook("second","healsystem")
function healsystem()
for id=1,32 do
if player(id,"item")==60 then
parse("sethealth "..id.." "..player(id,"health")+2)
end
end
end

EDT; i just realised. it never worked


EDT2: oh sorry. i never realised.. please remove this topic pelase
this is my script for the future
edited 4×, last 30.06.12 05:26:36 pm

old Re: is gas mask an armour or an weapon type?

DC
Admin Off Offline

Quote
You can't do it with the current version as I already tried to explain!

NEXT VERSION (NOT NOW) you'll be able to use
1
2
3
if player(id,"gasmask") then
	-- do healstuff
end

player(id,"item") doesn't work because this always returns the currently selected weapon in the hand of the player. The player NEVER uses the gasmask as weapon in its hand.
edited 1×, last 30.06.12 05:23:25 pm
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview