Forum

> > CS2D > Scripts > Hc ranks welcome Msg
Forums overviewCS2D overview Scripts overviewLog in to reply

English Hc ranks welcome Msg

8 replies
To the start Previous 1 Next To the start

old Hc ranks welcome Msg

Man Of Steel
User Off Offline

Quote
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.

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
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
}

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

old Re: Hc ranks welcome Msg

Gaios
Reviewer Off Offline

Quote
Rules §2.3 - No editing of posts to mark these as being new (pushing)

> Edit: sys/lua/hc/core/main.lua
1
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

old Re: Hc ranks welcome Msg

Man Of Steel
User Off Offline

Quote
@user Gaios:
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
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview