Forum

> > CS2D > Scripts > T & CT Boss script
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch T & CT Boss script

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt T & CT Boss script

RyceR
User Off Offline

Zitieren
Can any1 make script like that?
Random player in T is Boss - bosst[id]=1
Random player in CT is Boss - bossct[id]=1
Only it.

alt Re: T & CT Boss script

DannyDeth
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function choose_bosses()
	local T_ids={}
	local CT_ids={}
	local boss_ids={}
	for i=1,32 do
		if player(i,"team")==1 then
			T_ids[i]
		else
			CT_ids[i]
		end
	end
	boss_ids[0]=T_ids[math.random(0,#T_ids)
	boss_ids[1]=CT_ids[math.random(0,#CT_ids)
	return boss_ids
end

This code returns an array which has 2 fields, [0] is the T boss and [1] is the CT boss. You could do this to give the bosses medic armour:

1
2
3
bosses = choose_bosses()
parse("equip "..bosses[0].." 82")
parse("equip "..bosses[1].." 82")

~DannyDeth

alt Re: T & CT Boss script

Yasday
User Off Offline

Zitieren
1
2
3
4
5
6
function choose_bosses()
	local tbl = {}
	tbl[0] = player(0,"team1")[math.random(1,#player(1,"team1"))]
	tbl[1] = player(0,"team2")[math.random(1,#player(1,"team2"))]
	return tbl
end
Just like DannyDeth's code, but easier.
3× editiert, zuletzt 28.01.11 14:06:56

alt Re: T & CT Boss script

DannyDeth
User Off Offline

Zitieren
Uum? Easier? Yours is more efficient but not easier, I always write my script so they can easily be editted by newbies/people who are not familiar with Lua.

alt Re: T & CT Boss script

RyceR
User Off Offline

Zitieren
@DannyDeth but how to write in your script any1 like CTboss[id]=1 and Tboss[id]=1?
I need it for "Array" function.
1× editiert, zuletzt 28.01.11 15:37:26

alt Re: T & CT Boss script

DannyDeth
User Off Offline

Zitieren
@Rycer:
Like this, maybe?
1
2
3
bosses = choose_bosses()
CTboss[bosses[1]]=1
Tboss[bosses[0]]=1

You know the function "initArray"? That is similar to my function, all it does is return an array, so bosses[0] is the terrorist boss id and bosses[1] is the ct bosses id.

alt boss

thesk5tera
User Off Offline

Zitieren
plizz writhe the script i want zombie boss but one zombie in round and he have super armor and molotov cocktail and speed 5 plizz i need help
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht