lua:sampgetplayernickname

sampGetPlayerNickname

Опкод 0B36.
Требования: SA:MP.

name = sampGetPlayerNickname(int id)

Получает ник игрока, по его ID.

script_name("Example script")

function main()
   while not isSampAvailable() do wait(100) end
   while true do
   wait(0)
   local result, target = getCharPlayerIsTargeting(playerHandle)
   if result then result, playerid = sampGetPlayerIdByCharHandle(target) end
     if result and isKeyDown(VK_1) then
        name = sampGetPlayerNickname(playerid)
        print(name)
     end
   end
end