Forum

> > CS2D > Scripts > Class per round
Forums overviewCS2D overview Scripts overviewLog in to reply

English Class per round

7 replies
To the start Previous 1 Next To the start

old Class per round

Bobakrome
User Off Offline

Quote
I need some help. I'm good just at adminscripting and tibiascripting but i'm stuck i want to make my own mod but i need some help

1
2
3
4
sample.classes.class=initArray(32)
function sample.classes.classmenu(id)
	menu(id,"Class Selection,Slugger,FireFighter,Rocker,Boxer,Blitzer")	
end

Classes from samples and i want you can choose 1 per round, well the game type is deathmatch so 1 per restart??

old Re: Class per round

Apache uwu
User Off Offline

Quote
I think you mean:

1
2
3
4
5
6
7
addhook("startround","showmenus")

function showmenus()
	for _,id in ipairs(player(0,"tableliving")) do
		sample.classes.classmenu(id)
	end
end

old Re: Class per round

Alistaire
User Off Offline

Quote
Of course it doesn't work.

And you should change the hooks and shit to something else than "sample.classes.classmenu".

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
MenuPts={}
MenuPts[id]=0

addhook("startround","MenuPt")
function MenuPt()
	for _,id in ipairs(player(0,"tableliving")) do
		MenuPts[id]=1
	end
end

addhook("serveraction","MenuShow")
function MenuShow(id,action)
	if action = 1 then
		if MenuPts[id]=1 then
			sample.classes.classmenu(id)
		else
			msg2(id,"You can't change your class twice a game! And you stink!")
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview