ADD & REMOVE VIP
21 replies08.10.12 06:37:02 pm
Hi all! I'm here again to ask how do I add a command @addvip <usgn> or <id> (vip to add to the server) and @removevip <usgn> or <id> (to remove vip). Not forgetting that the vip will have rights to some skins and others.
Please show me how!
Please show me how!

Admin/mod comment:

You need a lua script like this one: http://www.unrealsoftware.de/files_show.php?file=6847

You need a lua script like this one: http://www.unrealsoftware.de/files_show.php?file=6847
You need to actually help people instead of suggesting the shittiest administration scripts uploaded here.
My script Have the command :
@give_vip [USGN]
@remove_vip [USGN]
http://unrealsoftware.de/files_show.php?file=11132
@give_vip [USGN]
@remove_vip [USGN]
http://unrealsoftware.de/files_show.php?file=11132

Hi all! I'm here again to ask how do I add a command @addvip <usgn> or <id> (vip to add to the server) and @removevip <usgn> or <id> (to remove vip). Not forgetting that the vip will have rights to some skins and others.
Please show me how!
Please show me how!

@

Code:
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
51
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
51
function Array(s,v)
local a = {}
for i = 1,s do
a[i] = v
end
return a
end
vip = Array(32,0)
function LoadAccount(id)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/"..usgn..".txt","r")
if file then
vip[id] = tonumber(file:read());
end
end
end
function SaveAccount(id,level)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/"..usgn..".txt","w")
file:write(level)
file:close()
end
end
addhook("join","_joinHook")
function _joinHook(id)
vip[id] = 0
LoadAccount(id)
if vip[id] == 1 then
msg2(id,"©000255000You are VIP!@C")
end
end
addhook("say","_sayHook")
function _sayHook(id,txt)
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
vip[pl] = 1
SaveAccount(pl,1)
return 1
elseif txt == "!removevip "..pl.."" then
vip[pl] = 0
SaveAccount(pl,0)
return 1
end
end
end
local a = {}
for i = 1,s do
a[i] = v
end
return a
end
vip = Array(32,0)
function LoadAccount(id)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/"..usgn..".txt","r")
if file then
vip[id] = tonumber(file:read());
end
end
end
function SaveAccount(id,level)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/"..usgn..".txt","w")
file:write(level)
file:close()
end
end
addhook("join","_joinHook")
function _joinHook(id)
vip[id] = 0
LoadAccount(id)
if vip[id] == 1 then
msg2(id,"©000255000You are VIP!@C")
end
end
addhook("say","_sayHook")
function _sayHook(id,txt)
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
vip[pl] = 1
SaveAccount(pl,1)
return 1
elseif txt == "!removevip "..pl.."" then
vip[pl] = 0
SaveAccount(pl,0)
return 1
end
end
end
edited 1×, last 09.10.12 02:06:48 pm

Better if you make a folder to every Usgn. Otherwise lua folder will get spammed!
Let him add folder.
edit for SaveAccount and LoadAccount change:
Code:
1
2
2
local file = io.open("sys/lua/"..usgn..".txt","r")
local file = io.open("sys/lua/"..usgn..".txt","w")
local file = io.open("sys/lua/"..usgn..".txt","w")
on
Code:
1
2
2
local file = io.open("sys/lua/saves/"..usgn..".txt","r")
local file = io.open("sys/lua/saves/"..usgn..".txt","w")
local file = io.open("sys/lua/saves/"..usgn..".txt","w")
You must create folder: saves
@
Gaios: Also better not add vip if he is already, don't you think?^^
Change this:
to
This looks better

Change this:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
addhook("say","_sayHook")
function _sayHook(id,txt)
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
vip[pl] = 1
SaveAccount(pl,1)
return 1
elseif txt == "!removevip "..pl.."" then
vip[pl] = 0
SaveAccount(pl,0)
return 1
end
end
end
function _sayHook(id,txt)
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
vip[pl] = 1
SaveAccount(pl,1)
return 1
elseif txt == "!removevip "..pl.."" then
vip[pl] = 0
SaveAccount(pl,0)
return 1
end
end
end
to
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
addhook("say","_sayHook")
function _sayHook(id,txt)
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
if vip[pl] == 0 then
vip[pl] = 1
SaveAccount(pl,1)
msg2(pl,"©255255255You're now VIP!")
return 1
else
msg2(id,"©255000000Error: The player you wanted to add is already VIP!")
end
elseif txt == "!removevip "..pl.."" then
if vip[pl] == 1 then
vip[pl] = 0
SaveAccount(pl,0)
msg2(pl,"©255255255Your vip status has been removed!")
return 1
else
msg2(id,"©255000000Error: This guy is NOT VIP!")
end
end
end
end
function _sayHook(id,txt)
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
if vip[pl] == 0 then
vip[pl] = 1
SaveAccount(pl,1)
msg2(pl,"©255255255You're now VIP!")
return 1
else
msg2(id,"©255000000Error: The player you wanted to add is already VIP!")
end
elseif txt == "!removevip "..pl.."" then
if vip[pl] == 1 then
vip[pl] = 0
SaveAccount(pl,0)
msg2(pl,"©255255255Your vip status has been removed!")
return 1
else
msg2(id,"©255000000Error: This guy is NOT VIP!")
end
end
end
end
This looks better

See, only a bit example
Code:
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
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
addhook("serveraction","a")
function a(if,a)
if a == 1 then
if vip[id] == 1 then
menu(id,"Test,A,B,C")
else
msg2(id,"©255255255Error, Only VIP Acess the Menu !")
end
end
end
addhook("menu","b")
function b(id,t,b)
if t == "Test" then
if b == 1 then
msg("123")
elseif b == 2 then
msg("1234")
elseif b == 3 then
msg("12345")
end
end
end
addhook("say","c")
function c(id,t
if vip[id] == 1 then
if t == "!on"
msg("©255255255 VIP : "..player(id,"name").." ON.")
else
msg2(id,"©255255255 Error, Commands Only to Vips")
return 1
end
end
end
function a(if,a)
if a == 1 then
if vip[id] == 1 then
menu(id,"Test,A,B,C")
else
msg2(id,"©255255255Error, Only VIP Acess the Menu !")
end
end
end
addhook("menu","b")
function b(id,t,b)
if t == "Test" then
if b == 1 then
msg("123")
elseif b == 2 then
msg("1234")
elseif b == 3 then
msg("12345")
end
end
end
addhook("say","c")
function c(id,t
if vip[id] == 1 then
if t == "!on"
msg("©255255255 VIP : "..player(id,"name").." ON.")
else
msg2(id,"©255255255 Error, Commands Only to Vips")
return 1
end
end
end
edited 1×, last 09.11.14 07:14:42 pm
I tab'd it if you don't mind
And changed some things in it.

And changed some things in it.
Code:
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
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
addhook("serveraction","_action")
function _action(id,action)
if action == 1 then
if vip[id] == 1 then
menu(id,"Test,A,B,C") -- THE MENU
else
--It's pointless to put Error text, in my opinon.
end
end
end
addhook("menu","_menu")
function _menu(id,title,button)
if title == "Test" then -- TITTLE OF MENU
if button == 1 then -- B = BUTTONS IN MENU
msg("123") --You can use menu(id,"Test2") too!
elseif button == 2 then
msg("1234")
elseif button == 3 then
msg("12345")
end
end
end
addhook("say","_say")
function _say(id,t)
if t == "!on" then
if vip[id] == 1 then
msg("©255255255"..player(id,"name").." |VIP| "..txt)
return 1
else
msg2(id,"©255255255This command is only for Vip/Admin!")
end
end
end
function _action(id,action)
if action == 1 then
if vip[id] == 1 then
menu(id,"Test,A,B,C") -- THE MENU
else
--It's pointless to put Error text, in my opinon.
end
end
end
addhook("menu","_menu")
function _menu(id,title,button)
if title == "Test" then -- TITTLE OF MENU
if button == 1 then -- B = BUTTONS IN MENU
msg("123") --You can use menu(id,"Test2") too!
elseif button == 2 then
msg("1234")
elseif button == 3 then
msg("12345")
end
end
end
addhook("say","_say")
function _say(id,t)
if t == "!on" then
if vip[id] == 1 then
msg("©255255255"..player(id,"name").." |VIP| "..txt)
return 1
else
msg2(id,"©255255255This command is only for Vip/Admin!")
end
end
end

Look there!
Recalling that is giving the error on line 33.
Code:
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
list_adm = {00000}
-- ADM
function ADMS(id)
for _, usgn in ipairs(list_adm) do
if (player(id,"usgn") == usgn) then
return true
end
end
return false
end
-- ARRAY
function initArray(m)
local array = {}
for i = 1, m do array[i]=0
end
return array
end
-- CODE
vip = initArray(32,0)
function LoadAccount(id)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/OCP 2.0/OCP config/"..usgn..".txt","r") -- Line error.
if file then
vip[id] = tonumber(file:read());
end
end
end
function SaveAccount(id,level)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/OCP 2.0/OCP config/"..usgn..".txt","w")
file:write(level)
file:close()
end
end
addhook("join","_joinHook")
function _joinHook(id)
vip[id] = 0
LoadAccount(id)
if vip[id] == 1 then
msg2(id,"©000255000You are VIP!@C")
end
end
addhook("say","_sayHook")
function _sayHook(id,txt)
if ADMS(id) then
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
if vip[pl] == 0 then
vip[pl] = 1
SaveAccount(pl,1)
msg2(pl,"©255255255You're now VIP!")
return 1
else
msg2(id,"©255000000Error: The player you wanted to add is already VIP!")
end
elseif txt == "!removevip "..pl.."" then
if vip[pl] == 1 then
vip[pl] = 0
SaveAccount(pl,0)
msg2(pl,"©255255255Your vip status has been removed!")
return 1
else
msg2(id,"©255000000Error: This guy is NOT VIP!")
end
end
end
end -- if ADMS
end
-- ADM
function ADMS(id)
for _, usgn in ipairs(list_adm) do
if (player(id,"usgn") == usgn) then
return true
end
end
return false
end
-- ARRAY
function initArray(m)
local array = {}
for i = 1, m do array[i]=0
end
return array
end
-- CODE
vip = initArray(32,0)
function LoadAccount(id)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/OCP 2.0/OCP config/"..usgn..".txt","r") -- Line error.
if file then
vip[id] = tonumber(file:read());
end
end
end
function SaveAccount(id,level)
local usgn = player(id,"usgn")
if usgn > 0 then
local file = io.open("sys/lua/OCP 2.0/OCP config/"..usgn..".txt","w")
file:write(level)
file:close()
end
end
addhook("join","_joinHook")
function _joinHook(id)
vip[id] = 0
LoadAccount(id)
if vip[id] == 1 then
msg2(id,"©000255000You are VIP!@C")
end
end
addhook("say","_sayHook")
function _sayHook(id,txt)
if ADMS(id) then
for pl = 1,32 do
if txt == "!addvip "..pl.."" then
if vip[pl] == 0 then
vip[pl] = 1
SaveAccount(pl,1)
msg2(pl,"©255255255You're now VIP!")
return 1
else
msg2(id,"©255000000Error: The player you wanted to add is already VIP!")
end
elseif txt == "!removevip "..pl.."" then
if vip[pl] == 1 then
vip[pl] = 0
SaveAccount(pl,0)
msg2(pl,"©255255255Your vip status has been removed!")
return 1
else
msg2(id,"©255000000Error: This guy is NOT VIP!")
end
end
end
end -- if ADMS
end
edited 1×, last 16.10.12 04:20:29 am
Maybe, you dont have folder OCP 2.0 and OCP Config.
When I am going to computer, then I fix the bug.
I read that all,
Thanks for information.
Thanks for information.
Even if someone says it's piece of shit, just don't listen to them ~ Factis Words.