Forum

> > CS2D > Scripts > [request]LUA MOD
Forums overviewCS2D overview Scripts overviewLog in to reply

English [request]LUA MOD

1 reply
To the start Previous 1 Next To the start

old [request]LUA MOD

super123s
User Off Offline

Quote
hi!
i have a file admin.lua>>here is the code:
Spoiler >

but i don't like this!why? look this code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
elseif cmd =="!arrest" then
local pl = tonumber(p[2])
local cell = tonumber(p[3])
if pl ~= nil then
if player(pl,"exists") then
if cell == 1 then
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][2])
elseif cell == 2 then
parse("setpos "..pl.." "..Config.AP[2][1].." "..Config.AP[2][2])
elseif cell == 3 then
parse("setpos "..pl.." "..Config.AP[3][1].." "..Config.AP[3][2])
end
rp_arrest[pl]=true
end
end
elseif cmd =="!free" then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
rp_arrest[pl]=false
parse("setpos "..pl.." "..Config.FP[1].." "..Config.FP[2])
end
end
i no want Member[admin == lv1] can arrest because....
i don't like it
please help me edit functions FREE / ARREST only for
Admin level>=2[admin level 2 , 3] please help me
request2:

i need some lua mod can print my wed >>in potision>>look the picture
request 3:i need lua commands like this
!s <id> <speed> ---speed mod
!k <id> <reason> ---- kick
!b <id> <reason>---- ban
!g <id> < weapon id> - give weapon for player
and more cmds:board cast message server without name
player
etc.. more please give me
edited 3×, last 30.07.11 04:37:48 am

old Re: [request]LUA MOD

Apache uwu
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
elseif cmd =="!arrest" then
local pl = tonumber(p[2])
local cell = tonumber(p[3])
if pl ~= nil then
if player(pl,"exists") then
if cell == 1 then
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][2])
elseif cell == 2 then
parse("setpos "..pl.." "..Config.AP[2][1].." "..Config.AP[2][2])
elseif cell == 3 then
parse("setpos "..pl.." "..Config.AP[3][1].." "..Config.AP[3][2])
end
rp_arrest[pl]=true
end
end
elseif cmd =="!free" then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
rp_arrest[pl]=false
parse("setpos "..pl.." "..Config.FP[1].." "..Config.FP[2])
end
end

Shows no sign of authentication checking. You could potentially just place a check right after the command such as.

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
elseif cmd =="!arrest" then
	if rank_level[id]>=2 then
local pl = tonumber(p[2])
local cell = tonumber(p[3])
if pl ~= nil then
if player(pl,"exists") then
if cell == 1 then
parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][2])
elseif cell == 2 then
parse("setpos "..pl.." "..Config.AP[2][1].." "..Config.AP[2][2])
elseif cell == 3 then
parse("setpos "..pl.." "..Config.AP[3][1].." "..Config.AP[3][2])
end
rp_arrest[pl]=true
end
end
end
elseif cmd =="!free" then
	if rank_lvl[id]>=2 then
local pl = tonumber(p[2])
if pl ~= nil then
if player(pl,"exists") then
rp_arrest[pl]=false
parse("setpos "..pl.." "..Config.FP[1].." "..Config.FP[2])
end
end 
end

That is only an example, replace rank_lvl with the appropriate array and id with the correct index.

For your next commands you can just add.

1
2
3
4
5
6
7
8
9
elseif cmd =="!s" then
	parse("speedmod "..p[2].." "..p[3])
elseif cmd =="!k" then
	parse("kick "..p[2].." "..p[3])
elseif cmd =="!b" then
	parse("banip "..p[2].." "..p[3])
elseif cmd =="!g" then
	parse("equip "..p[2].." "..p[3])
end

Please, I want to help but you need to learn English. Use capitalization, spacing, and tensing.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview