How do you make it so that only a player with a certain ID can choose that class (class 6 in this case)?
Forum
CS2D Scripts Lua Scripts/Questions/HelpHow do you make it so that only a player with a certain ID can choose that class (class 6 in this case)?
Class for one usgn id?
If yes then its very simple.
EDIT:
I need help here, if we admin, and the code like this
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
i = 1 	while (i <= #admins) do 	i = i + 1 	if (message == "!restart") then 	if (player(id, "usgn") == admins[i]) then 	msg("©255000000"..player(id, "name").." has restart the round") 	parse ("sv_restartround 1") 	return 1 	end 	end 	end
well, it's TheKilledDeath script tutorial i copied :D, anyway
if normal player type !restart and show message You cannot access to restart the game!, only admin can do this. help..
edited 2×, last 03.07.09 12:13:25 pm
Heavy has written
@Admirdee: Did you add his/her USGN-ID to the #admins array?
what did you mean? add someone name to be admin?
Arrays look like that:
1
admins = {USGNID, USGNID, USGNID,...}
edited 1×, last 03.07.09 12:34:33 pm
1
admins = {24053, 3353}
it's my USGN and my friend
So far I ended here:
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("hit","hit") function hit(id,source,weapon,hpdmg,apdmg) 	parse("strip id") 	if (hpdmg > 0) then 		parse("strip id") 		parse("equip source 75") 	end end
edited 2×, last 03.07.09 01:34:30 pm
Admirdee has written
I need help here, if we admin, and the code like this
..
well, it's TheKilledDeath script tutorial i copied :D, anyway
if normal player type !restart and show message You cannot access to restart the game!, only admin can do this. help..
..
well, it's TheKilledDeath script tutorial i copied :D, anyway
if normal player type !restart and show message You cannot access to restart the game!, only admin can do this. help..
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
i = 1 	while (i <= #admins) do 	i = i + 1 	if (message == "!restart") then 	if (player(id, "usgn") == admins[i]) then 	msg("©255000000"..player(id, "name").." has 	restart the round") 	parse ("sv_restartround 1") 	return 1 	else 	msg2(id,"You are not allowed to restart the game!") 	end 	end 	end
and more,
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("reload","adm.classes.reload") function adm.classes.reload(id,mode) 	if mode==1 then 	msg2(id,"©255255255Team: "..player(id,"name").." is reloading!") 	parse("sv_sound \"fun/reloading.wav\"") 	end end
I want make reload sound, if someone reload a weapon, then sound reloading come like normal. but I only want that sound for team only, if teammate reloading, that team only can hear, opponent team can't hear that.
is that i'm to much?
I made script where only one Usgn id can join on "Admin" class.
(Admin have laser , speedmod and super armor)
I think your USGN ID is "19547" ... Right?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function initArray(m) 	local array = {} 	for i = 1, m do 		array[i]=0 	end 	return array end class=initArray(32) function classmenu(id) 	menu(id,"Select your type,Simple User|Standart,Admin|19547") end addhook("team","team") function team(id,team) 	if (team>0) then 		classmenu(id) 	end end addhook("menu","menus") function menus(id,menu,sel) 	usgn = player(id, "usgn") 	if (menu=="Select your type") then 		if sel==1 then 			msg2(id,"©000255000Joined As Client@C") 			class[id]=1 		end 		if sel==2 then 			if usgn==19547 then 				msg2(id,"©000255000Joined As Admin@C") 				class[id]=2 			else 				msg2(id,"©255000000Usgn Id Dont Match@C") 				msg2(id,"©000255000Joined As Client@C") 				class[id]=1 			end 		end 	end end addhook("spawn","spawns") function spawns(id) 	if class[id]==2 then 		parse ("setmaxhealth "..id.." 250") 		parse ("setarmor "..id.." 200") 		parse ("speedmod "..id.." 100") 		return "45,83,"; 	end end
mat5b has written
So far I ended here:
I put it in and... nothing.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("hit","hit") function hit(id,source,weapon,hpdmg,apdmg) 	parse("strip id") 	if (hpdmg > 0) then 		parse("strip id") 		parse("equip source 75") 	end end
I tried now again and it worked, but only for player id 1,2, and 3, how to make it to all players?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function hit(id,source,weapon,hpdmg,apdmg) 	if (hpdmg > 0) then 		if (id == 1) then 			parse("equip 1 75") 			parse("strip 2 75") 			parse("strip 3 75") 		end 		if (id == 2) then 			parse("equip 2 75") 			parse("strip 1 75") 			parse("strip 3 75") 		end 		if (id == 3) then 			parse("equip 3 75") 			parse("strip 2 75") 			parse("strip 1 75") 		end 	end end
edited 3×, last 03.07.09 04:12:50 pm
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("hit","snowball") function snowball(id,source,weapon,hpdmg,apdmg) 		if (hpdmg > 0) then 			if(weapon==75) then 				parse("strip "..source.." 75") 				parse("equip "..id.." 75") 			end 		end end
Not tested.
edit:// worx for me
edited 1×, last 03.07.09 03:22:21 pm
For ZombieMod.
The Claw shouldn't kill a CT, it should make the CT to a T.
It's possible, I know
Skipper has written
I need a Lua
For ZombieMod.
The Claw shouldn't kill a CT, it should make the CT to a T.
It's possible, I know
For ZombieMod.
The Claw shouldn't kill a CT, it should make the CT to a T.
It's possible, I know
Same thing is not possible I think.
But possible to kill ct and make he spawn in same place he died.
edited 1×, last 17.01.10 12:35:20 am
Like this:
If Claw "touches" CT then make victim to T
Zombie will drop all weapons automatically?