Forum

> > CS2D > General > help whit classes script!!
Forums overviewCS2D overviewGeneral overviewLog in to reply

English help whit classes script!!

2 replies
To the start Previous 1 Next To the start

old help whit classes script!!

J4x OP
User Off Offline

Quote
Hello guys im new here but i have a few years playing cs2d ,i have the default classes script that comes with cs2d, but i have a problem , the bots always choose the first class ,how i change this?? and i like that only ct can choose a class because when i play with zombies they have weapons too. thx for ur answers

old Re: help whit classes script!!

Starkkz
Moderator Off Offline

Quote
The bots, always select the button "0" at menus.
So the lua check if the class id it's "0" or "1".
Try this function at spawn.

1
2
3
4
5
6
class_max = 6 -- Limit of class for bots.
addhook("spawn","sample.classes.spawn")
function sample.classes.spawn(id)
if sample.classes.class[id] == 0 then
	sample.classes.class[id] = math.random(1,class_max)
end
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview