Forum

> > CS2D > Scripts > dont know how to put together a script
Forums overviewCS2D overview Scripts overviewLog in to reply

English dont know how to put together a script

7 replies
To the start Previous 1 Next To the start

old dont know how to put together a script

ExecL
User Off Offline

Quote
i dont know how to put it together


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
if p == nil then p = {} end

p.owner = {} --Owner--
p.viceowner = {} --Vice-Owner--
p.admin = {} --Administrador--
p.mod = {} --Moderator--
p.member = {} --Member--
p.vip = {} --VIP--

addhook("say","p.psay")
function p.psay(id,txt)
if string.lower(txt) ~= "rank" then
if status(p.owner,id) then
msg("©000255255"..player(id,"name").." [Clan-Owner]: "..txt)
return 1
elseif status(p.viceowner,id) then
msg("©255000255"..player(id,"name").." [Clan-Vice-Owner]: "..txt)
return 1
elseif status(p.admin,id) then
msg("©000255000"..player(id,"name").." [Clan-Admin]: "..txt)
return 1
elseif status(p.mod,id) then
msg("©000000255"..player(id,"name").." [Clan-Moderator]: "..txt)
return 1
elseif status(p.member,id) then
msg("©255155000"..player(id,"name").." [Clan-Member]: "..txt)
return 1
elseif status(p.vip,id) then
msg("©255155000"..player(id,"name").." [V.I.P]: "..txt)
return 1
else
return 0
end
else
return 0
end
end

addhook("say","reset")
     function reset(id,txt)
          if(txt=="@rs") then
               parse ("setscore "..id.." 0")
               parse ("setdeaths "..id.." 0")
               parse ("sv_msg ©000000000"..player(id,"name").." used @ResetScore")
          return 1
     end
end

old Re: dont know how to put together a script

Cure Pikachu
User Off Offline

Quote
Here.
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
if p == nil then p = {} end

p.owner = {} --Owner--
p.viceowner = {} --Vice-Owner--
p.admin = {} --Administrador--
p.mod = {} --Moderator--
p.member = {} --Member--
p.vip = {} --VIP--

function status(table,id)
	for _, u in ipairs(table) do
		if player(id,"usgn") == u then
			return true
		end
	end
	return false
end

addhook("say","p.psay")
function p.psay(id,txt)
	if txt == "@rs" then
		parse("setscore "..id.." 0")
		parse("setdeaths "..id.." 0")
		msg("©000000000"..player(id,"name").." used @ResetScore")
		return 1
	elseif string.lower(txt) ~= "rank" then
		if status(p.owner,id) then
			msg("©000255255"..player(id,"name").." [Clan-Owner]: "..txt)
			return 1
		elseif status(p.viceowner,id) then
			msg("©255000255"..player(id,"name").." [Clan-Vice-Owner]: "..txt)
			return 1
		elseif status(p.admin,id) then
			msg("©000255000"..player(id,"name").." [Clan-Admin]: "..txt)
			return 1
		elseif status(p.mod,id) then
			msg("©000000255"..player(id,"name").." [Clan-Moderator]: "..txt)
			return 1
		elseif status(p.member,id) then
			msg("©255155000"..player(id,"name").." [Clan-Member]: "..txt)
			return 1
		elseif status(p.vip,id) then
			msg("©255155000"..player(id,"name").." [V.I.P]: "..txt)
			return 1
		end
	end
end
edited 3×, last 17.12.11 11:19:39 pm

old Re: dont know how to put together a script

The Camo
User Off Offline

Quote
Yeah i forgot the pairs stuff...

Edit, Hmm, user Cure Pikachu You helped me too

Didn't quite get that, because I was using pairs for something different, and it loads up only first usgn in the list, but now its working correctly. +rep

Thanks.
edited 1×, last 18.12.11 12:31:45 am
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview