Всем привет
как переделать скрипт, чтобы отправлять сообщения можно было не только по id, но и по никнейму.
пример: /pm id|nick text
function sendMessage(thePlayer, commandname, id, ...)
if ids[tonumber(id)] ~= nil then
local message = ""
for i,v in ipairs(arg) do
message = message.." "..v
end
outputChatBox("*PM Sent!",thePlayer,0,255,0)
outputChatBox("*PM from "..getPlayerName(thePlayer)..":"..message,ids[tonumber(id)],255,255,0)
else
outputChatBox("*Wrong id!",thePlayer,255,0,0)
end
end