English Name and usgn of the player who executes this cmd

4 replies
Goto Page
To the start Previous 1 Next To the start
Up
Destajador
User
Offline Off
Hi guys!

How can I have the usn of the person who kicks a player appear in print?
Line 6 of the code (Hc / admin scrip)


Code:
1
2
3
4
5
6
7
8
9
10
11
12
function hc.moderation.kick(p, _, item)
    local id = item.id
    local name = player(id, "name")
     local usgn = hc.get_usgn(id)
     local m = "#" .. id .. ": " .. name
     hc.event(hc.WHITE .. m .. " kick by" .. ??????????)
     
    if hc.check_exists(id) then
        hc.moderation.kill_if_flag_bearer(id)
        hc.exec(p, "kick " .. id)
    end
end
20.04.17 10:42:12 am
Up
MikuAuahDark
User
Offline Off
Looking for the structure, the variable p seems contain the player ID who execute the command. So, use
player(p, "name")
and
player(p, "usgn")
to retrieve it's name and USGN respectively.
AuahDark strikes again for one more time in Pixel Art server.
21.04.17 05:00:28 am
Up
Destajador
User
Offline Off
I think the variable does not work.
(Open the image in a new tab this way will appear in full screen)
Pd. Thanks to those who try to help.
21.04.17 06:02:11 am
Up
Talented Doge
User
Offline Off
From the
item.id
below in the ban function, I suppose that
item.id
is actually the one got kicked.

You used the usgn of the player with an id of
id
instead of
p
.

I know it is confusing, but it retrieves the id of the bot, instead of your own id.

So what you need to do is to change the
id
to
p
in line 86.
Fus~Ro Dah! | Check out Lord Sheogorath's great file cs2d THE WABBASNOWBALL! (11)
21.04.17 07:44:54 am
Up
Destajador
User
Offline Off
Solved, thank you very much √
To the start Previous 1 Next To the start