Forum

> > CS2D > Scripts > Auto Equip?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Auto Equip?

4 replies
To the start Previous 1 Next To the start

old Auto Equip?

OlaFPhp
User Off Offline

Quote
Can someone give me a code or script
when you startround you'll equip the weapon that you put in the lua.Pleaze.

old Re: Auto Equip?

DC
Admin Off Offline

Quote
that's one of the easiest things you can do
simply use the spawn-hook and its return value for this.

1
2
3
4
addhook("spawn","myspawn")
function myspawn()
	return "10,51";
end

the return value (in this case "10,51") has to be a comma separated list of items/weapons you want to equip. you can change, add or remove as many items as you want.

in this sample the script will equip an M3 and a HE on each spawn. note that a knife (or wrench) will also be added as well because each player needs a melee weapon.

put it in your sys/lua/server.lua

old Re: Auto Equip?

OlaFPhp
User Off Offline

Quote
Thx DC i was kind a not scripter though.
But what if cts only
and ts cannot.
edited 1×, last 22.02.11 11:25:58 am

old Re: Auto Equip?

GreenDevil
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
addhook("spawn","myspawn")
function myspawn()
	if (player(id,"team") == 2) then
	return "10,51";
	elseif
		(player(id,"team" == 1) then
	return ""
end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview