Spoiler copyright=string.char(169)
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
rp_license = Array(32,false)
player_have_pos = Array(32,false)
collect = Array(32,1)
tele_x = Array(32,0)
tele_y = Array(32,0)
addhook("leave","license_leave")
function license_leave(id)
rp_license[id]=0
collect[id]=0
player_have_pos[id]=false
end
addhook("serveraction","license_action")
function license_action(id,b)
if rp_license[id]==true and b==2 then
menu(id,"License Menu,Set Position,Teleport to Position,Collect Mode")
else
msg2(id,"You don't have a license!")
return 1
end
end
addhook("menu","license_menu")
function license_menu(id,title,button)
x = player(id,[[tilex]])
y = player(id,[[tiley]])
if title=="License Menu" then
if button==1 then
tele_x[id] = player(id,[[x]])
tele_y[id] = player(id,[[y]])
player_have_pos[id]=true
msg2(id,"You've saved your Position!")
elseif button==2 and player_have_pos[id]==true then
local x, y
x = player( id, "x")
y = player( id, "y")
parse([[setpos ]]..id..[[ ]]..tele_x[id]..[[ ]]..tele_y[id])
parse('effect "colorsmoke" ' ..x.. ' ' ..y.. ' 20 20 255 192 203')
msg2(id,"Teleport sucess!")
elseif button==2 and player_have_pos[id]==false then
msg2(id,"You can't teleport yourself without position setted!")
elseif button==3 and collect[id]==0 then
msg2(id,"Collection OFF")
collect[id]=1
elseif button==3 and collect[id]==1 then
msg2(id,"Collection ON")
collect[id]=0
end
end
end
addhook("buildattempt","rp_build")
function rp_build(id)
if rp_license[id]==true then
return 0
elseif rp_license[id]==false then
msg2(id,copyright.."255000000You must to be licensed to build!@C")
return 1
end
end
function rp_msg2(id,clr,txt)
msg2(id,[[夜]..clr..[[]]..txt)
end
addhook([[menu]],[[rp_menu]])
function rp_menu(id,men,sel)
x = player(id,[[tilex]])
y = player(id,[[tiley]])
if men == [[License System Page 5]] then
if sel == 1 then
gv_ls(id,29,5)
elseif sel == 2 then
gv_ls(id,30,5)
elseif sel == 3 then
gv_ls(id,31,5)
elseif sel == 4 then
gv_ls(id,32,5)
elseif sel == 7 then
ls_4(id)
end
end
if men == [[License System Page 4]] then
if sel == 1 then
gv_ls(id,22,4)
elseif sel == 2 then
gv_ls(id,23,4)
elseif sel == 3 then
gv_ls(id,24,4)
elseif sel == 4 then
gv_ls(id,25,4)
elseif sel == 5 then
gv_ls(id,26,4)
elseif sel == 6 then
gv_ls(id,27,4)
elseif sel == 7 then
gv_ls(id,28,4)
elseif sel == 8 then
ls_3(id)
elseif sel == 9 then
ls_5(id)
end
end
if men == [[License System Page 3]] then
if sel == 1 then
gv_ls(id,15,3)
elseif sel == 2 then
gv_ls(id,16,3)
elseif sel == 3 then
gv_ls(id,17,3)
elseif sel == 4 then
gv_ls(id,18,3)
elseif sel == 5 then
gv_ls(id,19,3)
elseif sel == 6 then
gv_ls(id,20,3)
elseif sel == 7 then
gv_ls(id,21,3)
elseif sel == 8 then
ls_2(id)
elseif sel == 9 then
ls_4(id)
end
end
if men == [[License System Page 2]] then
if sel == 1 then
gv_ls(id,8,2)
elseif sel == 2 then
gv_ls(id,9,2)
elseif sel == 3 then
gv_ls(id,10,2)
elseif sel == 4 then
gv_ls(id,11,2)
elseif sel == 5 then
gv_ls(id,12,2)
elseif sel == 6 then
gv_ls(id,13,2)
elseif sel == 7 then
gv_ls(id,14,2)
elseif sel == 8 then
ls_1(id)
elseif sel == 9 then
ls_3(id)
end
end
if men == [[License System Page 1]] then
if sel == 1 then
gv_ls(id,1,1)
elseif sel == 2 then
gv_ls(id,2,1)
elseif sel == 3 then
gv_ls(id,3,1)
elseif sel == 4 then
gv_ls(id,4,1)
elseif sel == 5 then
gv_ls(id,5,1)
elseif sel == 6 then
gv_ls(id,6,1)
elseif sel == 7 then
gv_ls(id,7,1)
addhook("walkover","license_collect")
function license_collect(id)
if collect[id]==1 then
return 1
elseif collect[id]==0 then
return 0
end
end
pl_names = Array(32,"")
function b_names()
for i = 1,32 do
if player(i,[[exists]]) then
pl_names[i]=player(i,[[name]])
else
pl_names[i]=""
end
end
end
function ls_1(id)
b_names()
menu(id,[[License System Page 1@b,]]..pl_names[1]..[[,]]..pl_names[2]..[[,]]..pl_names[3]..[[,]]..pl_names[4]..[[,]]..pl_names[5]..[[,]]..pl_names[6]..[[,]]..pl_names[7]..[[,Back,Next]])
end
function ls_2(id)
b_names()
menu(id,[[License System Page 2@b,]]..pl_names[8]..[[,]]..pl_names[9]..[[,]]..pl_names[10]..[[,]]..pl_names[11]..[[,]]..pl_names[12]..[[,]]..pl_names[13]..[[,]]..pl_names[14]..[[,Back,Next]])
end
function ls_3(id)
b_names()
menu(id,[[License System Page 3@b,]]..pl_names[15]..[[,]]..pl_names[16]..[[,]]..pl_names[17]..[[,]]..pl_names[18]..[[,]]..pl_names[19]..[[,]]..pl_names[20]..[[,]]..pl_names[21]..[[,Back,Next]])
end
function ls_4(id)
b_names()
menu(id,[[License System Page 4@b,]]..pl_names[22]..[[,]]..pl_names[23]..[[,]]..pl_names[24]..[[,]]..pl_names[25]..[[,]]..pl_names[26]..[[,]]..pl_names[27]..[[,]]..pl_names[28]..[[,Back,Next]])
end
function ls_5(id)
b_names()
menu(id,[[License System Page 5@b,]]..pl_names[29]..[[,]]..pl_names[30]..[[,]]..pl_names[31]..[[,]]..pl_names[32]..[[,,,,Back]])
end
function gv_ls(id,pl,page)
if rp_license[pl]==true then
rp_license[pl]=false
rp_msg2(pl,[[255000000]],player(id,[[name]])..[[ Remove your license!]])
rp_msg2(id,[[255000000]],[[You Remove license to ]]..player(pl,[[name]])..[[!]])
else
rp_license[pl]=true
rp_msg2(pl,[[000255000]],player(id,[[name]])..[[ Gave you license!]])
rp_msg2(id,[[000255000]],[[You gave license to ]]..player(pl,[[name]])..[[!]])
end
if page == 1 then
ls_1(id)
elseif page == 2 then
ls_2(id)
elseif page == 3 then
ls_3(id)
elseif page == 4 then
ls_4(id)
elseif page == 5 then
ls_5(id)
end
end
end
end
end