function main()
repeat wait(100) until isSampAvailable()
while true do
wait(0)
local pid, tar = getCharPlayerIsTargeting(playerHandle)
if pid then pid, tarId = sampGetPlayerIdByCharHandle(tar) end
if pid and isKeyDown(VK_RBUTTON) and isKeyJustPressed(VK_X) then
local tarName = sampGetPlayerNickname(tarId)
print(tarId, tarName)
end
end
end