I sent bad error, my mistake I'm sorry.
That was error of something else.
My problem is not writing errors to log, but it's not working too.
There is code:
function callphonenumber(thePlayer, cmd, tostring(phonenumber2), ...)
if phonenumber2 then
-- PHONENUMBER2
if (phonenumber2 == "222222222") then
local player2 = getPlayerFromName("Ervin_Balog")
elseif (phonenumber2 == "755167267") then
local player2 = getPlayerFromName("Alex_James")
elseif (phonenumber2 == "752786786") then
local player2 = getPlayerFromName("John_Skot")
elseif (phonenumber2 == "756842354") then
local player2 = getPlayerFromName("Bohumil_Jentky")
end
-- PHONENUMBER1
if (getPlayerName(thePlayer) == "Ervin_Balog") then
local phonenumber1 = "222222222"
elseif (getPlayerName(thePlayer) == "Alex_James") then
local phonenumber1 = "755167267"
elseif (getPlayerName(thePlayer) == "John_Skot") then
local phonenumber1 = "752786786"
elseif (getPlayerName(thePlayer) == "Bohumil_Jentky") then
local phonenumber1 = "756842354"
end
if player2 and phonenumber1 then
local msg = table.concat({...}, " ")
if (msg and msg ~= "") then
outputChatBox("[PHONE-"..phonenumber1.."]: ".. msg .." ",player2,255,150,30,true)
outputChatBox("Message has been sent.",thePlayer,255,150,30,true)
end
end
end
end
addCommandHandler("phone",callphonenumber)