Hc ranks welcome Msg
8 replies



10.06.18 12:41:42 pm
Hi everyone, I came for need help about hc Admin script.
I added new ranks in hc admin script. script working perfect after add new ranks (No Error), now i want to add separate welcome messages each other rank, i tried hard to add it myself but always error show and i can't fix it.So i hope anybody will help me.i want welcome msg according to my levels
I added these ranks are given below.
Please help me for add welcome messages of each other level also hc.USER.
Thanks for attention
I added new ranks in hc admin script. script working perfect after add new ranks (No Error), now i want to add separate welcome messages each other rank, i tried hard to add it myself but always error show and i can't fix it.So i hope anybody will help me.i want welcome msg according to my levels
I added these ranks are given below.
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
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
hc.user.USER_LEVELS = {
{ title = "Guest", level = hc.USER },
"",
{ title = "VIP", level = hc.VIP },
{ title = "Super V.I.P", level = hc.VIP2 },
"",
{ title = "Junior Moderator", level = hc.MODERATOR0 },
{ title = "Moderator", level = hc.MODERATOR1 },
{ title = "Senior Moderator", level = hc.MODERATOR2 },
"",
{ title = "Administrator", level = hc.COADMINISTRATOR },
{ title = "Owner", level = hc.ADMINISTRATOR }
}
hc.user.COLOURS = {
[hc.SPEC] = "",
[hc.T] = hc.T_RED,
[hc.CT] = hc.CT_BLUE
}
hc.user.SHORT_NAMES = {
[hc.USER] = "User",
[hc.VIP] = "VIP",
[hc.VIP2] = "SVIP",
[hc.MODERATOR0] = "Moderator1",
[hc.MODERATOR1] = "Moderator2",
[hc.MODERATOR2] = "Moderator3",
[hc.COADMINISTRATOR] = "Adm",
[hc.ADMINISTRATOR] = "Owner"
}
hc.user.NAME_TO_LEVEL = {
VIP = hc.VIP,
SVIP = hc.VIP2,
Moderator1 = hc.MODERATOR0,
Moderator2 = hc.MODERATOR1,
Moderator3 = hc.MODERATOR2,
Adm = hc.COADMINISTRATOR,
Owner = hc.ADMINISTRATOR
}
{ title = "Guest", level = hc.USER },
"",
{ title = "VIP", level = hc.VIP },
{ title = "Super V.I.P", level = hc.VIP2 },
"",
{ title = "Junior Moderator", level = hc.MODERATOR0 },
{ title = "Moderator", level = hc.MODERATOR1 },
{ title = "Senior Moderator", level = hc.MODERATOR2 },
"",
{ title = "Administrator", level = hc.COADMINISTRATOR },
{ title = "Owner", level = hc.ADMINISTRATOR }
}
hc.user.COLOURS = {
[hc.SPEC] = "",
[hc.T] = hc.T_RED,
[hc.CT] = hc.CT_BLUE
}
hc.user.SHORT_NAMES = {
[hc.USER] = "User",
[hc.VIP] = "VIP",
[hc.VIP2] = "SVIP",
[hc.MODERATOR0] = "Moderator1",
[hc.MODERATOR1] = "Moderator2",
[hc.MODERATOR2] = "Moderator3",
[hc.COADMINISTRATOR] = "Adm",
[hc.ADMINISTRATOR] = "Owner"
}
hc.user.NAME_TO_LEVEL = {
VIP = hc.VIP,
SVIP = hc.VIP2,
Moderator1 = hc.MODERATOR0,
Moderator2 = hc.MODERATOR1,
Moderator3 = hc.MODERATOR2,
Adm = hc.COADMINISTRATOR,
Owner = hc.ADMINISTRATOR
}
Please help me for add welcome messages of each other level also hc.USER.
Thanks for attention
edited 2×, last 11.06.18 02:10:14 pm
FRiendly boYy.


Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
function hc.main.pre_join_hook(p)
local player_level = hc.get_level(p)
hc.info(p, "Welcome, " .. player(p, "name") .. "!")
hc.info(p, "Your rank is: " .. hc.get_level_short_name(player_level))
-- you can also do such:
if player_level == hc.VIP then
-- code
end
hc.main.init_player(p, hc.PLAYER_JOIN)
end
local player_level = hc.get_level(p)
hc.info(p, "Welcome, " .. player(p, "name") .. "!")
hc.info(p, "Your rank is: " .. hc.get_level_short_name(player_level))
-- you can also do such:
if player_level == hc.VIP then
-- code
end
hc.main.init_player(p, hc.PLAYER_JOIN)
end
@
Gaios:
Thanks a lot but there is an Error even its working but i set my level Owner in data > Config > users like this
Error is
And i really hope you'll help me again

Thanks a lot but there is an Error even its working but i set my level Owner in data > Config > users like this
159747,Owner,Your Name
I'm always show in User level even i set Owner level.Error is
LUA ERROR: sys/lua/hc/core/user.lua:91: table index is nil
And i really hope you'll help me again

FRiendly boYy.
hc.OWNER
is not set, moron. Admin/mod comment:

Show full code error and the following lines, idiot. How the fu*k can we debug your script with the error line only?!
Admin/mod comment:

@
Gaios: If you want to blame rather than help, how the fuck can he communicate with you?

Create your UI easy and fast: UI Framework | Go deeper into the darkness and test your bravery:
Outlast 2 Modification (27)


Please paste this file:
user.lua
either on site or at www.pastebin.com if it's too large. Guys thanks a lot, Sorry that was my fault script @
Gaios: script Working Thanks.

edited 1×, last 13.06.18 10:26:40 am
FRiendly boYy.



