Forum

> > CS2D > Scripts > Auto Equip?
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Auto Equip?

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Auto Equip?

OlaFPhp
User Off Offline

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

alt Re: Auto Equip?

DC
Admin Off Offline

Zitieren
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

alt Re: Auto Equip?

OlaFPhp
User Off Offline

Zitieren
Thx DC i was kind a not scripter though.
But what if cts only
and ts cannot.
1× editiert, zuletzt 22.02.11 11:25:58

alt Re: Auto Equip?

GreenDevil
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht