English T & CT Boss script

9 replies
Goto Page
To the start Previous 1 Next To the start
28.01.11 10:20:31 am
Up
RyceR
User
Offline Off
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.
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
28.01.11 01:50:26 pm
Up
DannyDeth
User
Offline Off
Code:
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:

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


~DannyDeth
28.01.11 02:00:11 pm
Up
Yasday
User
Offline Off
Code:
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.
edited 3×, last 28.01.11 02:06:56 pm
28.01.11 02:01:21 pm
Up
DannyDeth
User
Offline Off
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.
28.01.11 03:30:10 pm
Up
RyceR
User
Offline Off
@DannyDeth but how to write in your script any1 like CTboss[id]=1 and Tboss[id]=1?
I need it for "Array" function.
edited 1×, last 28.01.11 03:37:26 pm
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
28.01.11 03:35:22 pm
Up
DannyDeth
User
Offline Off
@Rycer:
Like this, maybe?
Code:
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.
28.01.11 03:38:17 pm
Up
RyceR
User
Offline Off
Ok, work, thank you.
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
28.01.11 03:42:18 pm
Up
DannyDeth
User
Offline Off
Pleasure to help. Any time
28.01.11 03:53:08 pm
Up
RyceR
User
Offline Off
Ok, work, thank you.
EDIT: Sorry, i press bad button, its spam post
IMG:http://img704.imageshack.us/img704/4043/userbargimp.png
09.03.13 12:54:57 pm
Up
thesk5tera
User
Offline Off
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
To the start Previous 1 Next To the start