Forum

> > CS2D > Scripts > Name and usgn of the player who executes this cmd
Forums overviewCS2D overview Scripts overviewLog in to reply

English Name and usgn of the player who executes this cmd

4 replies
To the start Previous 1 Next To the start

old Name and usgn of the player who executes this cmd

cs2d_is_a_Gem
User Off Offline

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


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

old Re: Name and usgn of the player who executes this cmd

Talented Doge
User Off Offline

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