Forum

> > CS2D > Scripts > Clan tag
Forums overviewCS2D overview Scripts overviewLog in to reply

English Clan tag

24 replies
Page
To the start Previous 1 2 Next To the start

old Clan tag

Jabama
User Off Offline

Quote
After searching the scripts, I wanted to know if there was a way that a button in f3/f4 could be made saying clan tag ON/OFF (whether it was on or off). It would be amazing if someone could write one. Clan tag=#Lewa |

old Re: Clan tag

Jynxxx
User Off Offline

Quote
I'm guessing this is what you want.
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
Clan = {}

addhook("join","_join")
function _join(id)
	Clan[id] = {clantag = "#Lewa | ", clant = 0}
end

addhook("serveraction","_action")
function _action(id,action)
	if action == 1 then
		if Clan[id].clant == 0 then
			Clan[id].clant = 1
			msg2(id,"©000255000Tag has been turned on!")
		else
			Clan[id].clant = 0
			msg2(id,"©000255000Tag has been turned off!")
		end
	end
end

addhook("say","_say")
function _say(id,text)
	if Clan[id].clant == 1 then
		msg("©255000000"..Clan[id].clantag..""..player(id,"name")..": "..text)
		return 1
	else
     
	end
end

old Re: Clan tag

Jabama
User Off Offline

Quote
Yeah, I mean when I press f3 I get the option, not just when I come on.

old Re: Clan tag

ExecL
User Off Offline

Quote
user Jabama has written
Yeah, I mean when I press f3 I get the option, not just when I come on.


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
Clan = {}

addhook("join","_join")
function _join(id)
     Clan[id] = {clantag = "#Lewa | ", clant = 0}
end

addhook("serveraction","_action")
function _action(id,action)
	if action == 1 then
		menu(id,"Clan Tag,On,Off")
	end
end

addhook("menu","_menu")
function _menu(id,title,button) 
	if title == "Clan Tag" then
		if button == 1 then
			if Clan[id].clant == 0 then
				Clan[id].clant = 1
				msg2(id,"©000255000Tag has been turned on!")
			end
		end
		if button == 2 then
			Clan[id].clant = 0
			msg2(id,"©000255000Tag has been turned off!")
		end
	end
end

addhook("say","_say")
function _say(id,text)
     if Clan[id].clant == 1 then
          msg("©255000000"..Clan[id].clantag..""..player(id,"name")..": "..text)
          return 1
     else
     
     end
end

Like this?

old Re: Clan tag

Jabama
User Off Offline

Quote
Yeah, but when I press on it doesn't do anything.

old Re: Clan tag

Jabama
User Off Offline

Quote
That's too confusing.. I want something simple.

old Re: Clan tag

Flacko
User Off Offline

Quote
I'm guessing this will require a table with all the USGN ids of your members, right?

old Re: Clan tag

ExecL
User Off Offline

Quote
user Jabama has written
Yeah, but when I press on it doesn't do anything.


Press F2 and it will open a menu.

old Re: Clan tag

ExecL
User Off Offline

Quote
user Jabama has written
Yeah. Is that hard?


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
Clan = {}

addhook("join","_join")
function _join(id)
     Clan[id] = {clantag = "#Lewa | ", clant = 0}
end

addhook("serveraction","_action")
function _action(id,action)
	if action == 2 then
		menu(id,"Clan Tag,On,Off")
	end
end

addhook("menu","_menu")
function _menu(id,title,button) 
	if title == "Clan Tag" then
		if button == 1 then
			if Clan[id].clant == 0 then
				Clan[id].clant = 1
				msg2(id,"©000255000Tag has been turned on!")
			end
		end
		if button == 2 then
			Clan[id].clant = 0
			msg2(id,"©000255000Tag has been turned off!")
		end
	end
end

addhook("say","_say")
function _say(id,text)
     if Clan[id].clant == 1 then
          msg("©255000000"..Clan[id].clantag..""..player(id,"name")..": "..text)
          return 1
     else
     
     end
end

Here, press F3 and it will open a menu

old Re: Clan tag

Jabama
User Off Offline

Quote
Yeah, but when I put it on it says AC550000000 #LeWa | Jabama. And there is no switch.

old Re: Clan tag

ExecL
User Off Offline

Quote
I've tested it and it works fine. whats ur in-game name?

old Re: Clan tag

ExecL
User Off Offline

Quote
Are you pressing F3(key at the top)
If you are, is a menu opening?

like this? "AC550000000 #Lewa | Jabama"

idk how that would happend.

Are you running any other scripts,
and are you putting it in sys/lua/server.lua?

old Re: Clan tag

Jabama
User Off Offline

Quote
Yes a menu is opening, but the buttons don't do anything now.

And Yeah like that.

I was running an admin script, but I've put everything else in the samples, and now it doesn't work at all.

And No I'm not.

cookie

old Re: Clan tag

ExecL
User Off Offline

Quote
make a text file and save it as server.lua in sys/lua and put the lua in there, save it and run cs2d should work now.

dont run any other scripts!

pm me the admin script you were using.
To the start Previous 1 2 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview