Forum

> > CS2D > Scripts > Changing random weapons/equipment on round start.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Changing random weapons/equipment on round start.

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Changing random weapons/equipment on round start.

VX
User Off Offline

Zitieren
So like, I need help with a script where on each round you get different varieties of weapons on each round, similar to the [LaG] Fun one, sometimes you could get a Mac 10 w/ HE's, Tactical Shield w/ Laser Mines, etc. So could anyone help me with this?

Thanks
-VX

alt Re: Changing random weapons/equipment on round start.

Patasuss
User Off Offline

Zitieren
Just made the script for you:
1
2
3
4
5
6
7
8
9
10
11
--Arrays holding weapon ids
pistols={1,2,3,4,5,6}
mainweapons={10,11,20,21,22,23,24,30,31,32,33,34,35,36,37,38,39,40,41,45,46,47,48,49,88}
grens={51,52,53,54,72,73,75,76,77,86,87}
armor={57,58,79,80,81,82,83,84}
handweapons={69,74,78,85}

addhook("spawn","PSpawn")
function PSpawn(id)
return pistols[math.random(#pistols)]..","..mainweapons[math.random(#mainweapons)]..","..grens[math.random(#grens)]..","..armor[math.random(#armor)]..","..handweapons[math.random(#handweapons)]
end

edit: yay a bug in the forum-software

alt Re: Changing random weapons/equipment on round start.

EngiN33R
Moderator Off Offline

Zitieren
I'll edit Patasuss's script.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--Arrays holding weapon ids
pistols={1,2,3,4,5,6}
mainweapons={10,11,20,21,22,23,24,30,31,32,33,34,35,36,37,38,39,40,41,45,46,47,48,49,88}
grens={51,52,53,54,72,73,75,76,77,86,87}
armor={57,58,79,80,81,82,83,84}
handweapons={69,74,78,85}

addhook("startround","WeaponsRand")
function WeaponsRand()
pist=math.random(#pistols)
mw=math.random(#mainweapons)
grn=math.random(#grens)
armr=math.random(#armor)
hw=math.random(#handweapons)
end

addhook("spawn","PSpawn")
function PSpawn(id)
return pistols[pist]..","..mainweapons[mw]..","..grens[grn]..","..armor[armr]..","..handweapons[hw]
end
1× editiert, zuletzt 09.01.11 19:31:11

alt Re: Changing random weapons/equipment on round start.

VX
User Off Offline

Zitieren
That's better, but people still spawn with the same equipment from the last round, is there some way to clear all the weapons from the last round, and respawn with random weapons on the roundstart?

alt Re: Changing random weapons/equipment on round start.

oxytamine
User Off Offline

Zitieren
Patasuss hat geschrieben
Just made the script for you:
1
2
3
4
5
6
7
8
9
10
11
--Arrays holding weapon ids
pistols={1,2,3,4,5,6}
mainweapons={10,11,20,21,22,23,24,30,31,32,33,34,35,36,37,38,39,40,41,45,46,47,48,49,88}
grens={51,52,53,54,72,73,75,76,77,86,87}
armor={57,58,79,80,81,82,83,84}
handweapons={69,74,78,85}

addhook("spawn","PSpawn")
function PSpawn(id)
return pistols[math.random(#pistols)]..","..mainweapons[math.random(#mainweapons)]..","..grens[math.random(#grens)]..","..armor[math.random(#armor)]..","..handweapons[math.random(#handweapons)]
end

edit: yay a bug in the forum-software

Excuse me, sir, can you help me, and edit your script a little, so the weapons will be cleared every round? I wanna start a server with such script.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht