From 2085604ac07b6e03ad846eea89c4f7e74ff7d263 Mon Sep 17 00:00:00 2001 From: ErikasKontenis Date: Sun, 22 Mar 2020 16:14:14 +0200 Subject: [PATCH] allow tutors to use info command and to spectate items like pro --- data/events/scripts/player.lua | 2 +- data/talkactions/scripts/info.lua | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/data/events/scripts/player.lua b/data/events/scripts/player.lua index 0cf8a29..500b588 100644 --- a/data/events/scripts/player.lua +++ b/data/events/scripts/player.lua @@ -1,6 +1,6 @@ function Player:onLook(thing, position, distance) local description = "You see " .. thing:getDescription(distance) - if self:getGroup():getAccess() then + if self:getAccountType() ~= ACCOUNT_TYPE_NORMAL then if thing:isItem() then description = string.format("%s\nItem ID: %d", description, thing:getId()) diff --git a/data/talkactions/scripts/info.lua b/data/talkactions/scripts/info.lua index 8969b1c..3708741 100644 --- a/data/talkactions/scripts/info.lua +++ b/data/talkactions/scripts/info.lua @@ -1,5 +1,5 @@ function onSay(player, words, param) - if not player:getGroup():getAccess() then + if player:getAccountType() == ACCOUNT_TYPE_NORMAL then return true end @@ -8,7 +8,7 @@ function onSay(player, words, param) player:sendCancelMessage("Player not found.") return false end - + if target:getAccountType() > player:getAccountType() then player:sendCancelMessage("You can not get info about this player.") return false @@ -17,10 +17,12 @@ function onSay(player, words, param) local targetIp = target:getIp() player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Name: " .. target:getName()) player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Access: " .. (target:getGroup():getAccess() and "1" or "0")) - player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Level: " .. target:getLevel()) - player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Magic Level: " .. target:getMagicLevel()) - player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Speed: " .. target:getSpeed()) - player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Position: " .. string.format("(%0.5d / %0.5d / %0.3d)", target:getPosition().x, target:getPosition().y, target:getPosition().z)) + if player:getGroup():getAccess() then + player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Level: " .. target:getLevel()) + player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Magic Level: " .. target:getMagicLevel()) + player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Speed: " .. target:getSpeed()) + player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Position: " .. string.format("(%0.5d / %0.5d / %0.3d)", target:getPosition().x, target:getPosition().y, target:getPosition().z)) + end player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "IP: " .. Game.convertIpToString(targetIp)) local players = {}