Helló! Egy gondom akadt amit nem tudok megoldani és a segítségeteket kérném :SSSS
[2015-01-10 22:28:45] WARNING: phone-system/s_hotlines.lua:146: Bad argument @ \'getPlayersInTeam\' [Expected team at argument 1, got boolean]
[2015-01-10 22:28:45] ERROR: phone-system/s_hotlines.lua:146: bad argument #1 to \'ipairs\' (table expected, got boolean)
function isNumberAHotline(theNumber)
local challengeNumber = tonumber(theNumber)
return challengeNumber == 911 or challengeNumber == 311 or challengeNumber == 411 or challengeNumber == 511 or challengeNumber == 611 or challengeNumber == 921 or challengeNumber == 1501 or challengeNumber == 1502 or challengeNumber == 8294 or challengeNumber == 7331 or challengeNumber == 7332 or challengeNumber == 864
end
function routeHotlineCall(callingElement, callingPhoneNumber, outboundPhoneNumber, startingCall, message)
local callprogress = getElementData(callingElement, \"callprogress\")
if callingPhoneNumber == 911 then
-- 911: Emergency Services and Police.
-- Emergency calls that they need to respond to.
if startingCall then
outputChatBox(\"911 Operator [Cellphone]: 911 emergency. Please state your location.\", callingElement)
exports[\'anticheat-system\']:changeProtectedElementDataEx(callingElement, \"callprogress\", 1, false)
else
if (callprogress==1) then -- Requesting the location
exports[\'anticheat-system\']:changeProtectedElementDataEx(callingElement, \"call.location\", message, false)
exports[\'anticheat-system\']:changeProtectedElementDataEx(callingElement, \"callprogress\", 2, false)
outputChatBox(\"911 Operator [Cellphone]: Can you describe your emergency please?\", callingElement)
elseif (callprogress==2) then -- Requesting the situation
outputChatBox(\"911 Operator [Cellphone]: Thanks for your call, we\'ve dispatched a unit to your location.\", callingElement)
local location = getElementData(callingElement, \"call.location\")
local playerStack = { }
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"Los Santos Police Department\" ) ) ) do
table.insert(playerStack, value)
end
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"State Police\" ) ) ) do
table.insert(playerStack, value)
end
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"Los Santos Medical Services\" ) ) ) do
table.insert(playerStack, value)
end
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"Los Santos Fire Department\" ) ) ) do
table.insert(playerStack, value)
end
local affectedElements = { }
for key, value in ipairs( playerStack ) do
for _, itemRow in ipairs(exports[\'item-system\']:getItems(value)) do
local setIn = false
if (not setIn) and (itemRow[1] == 6 and itemRow[2] > 0) then
table.insert(affectedElements, value)
setIn = true
break
end
end
end
for key, value in ipairs( affectedElements ) do
outputChatBox(\"[RADIO] This is dispatch, We\'ve got an incident call from #\" .. outboundPhoneNumber .. \", Over.\", value, 0, 183, 239)
outputChatBox(\"[RADIO] Situation: \'\" .. message .. \"\', Over.\", value, 0, 183, 239)
outputChatBox(\"[RADIO] Location: \'\" .. tostring(location) .. \"\', Out.\", value, 0, 183, 239)
end
executeCommandHandler( \"hangup\", callingElement )
end
end
A Segítségeteket előre is köszönöm
Létre vannak hozva és ugyan ezt írja.
[2015-01-11 15:17:55] WARNING: phone-system/s_hotlines.lua:30: Bad argument @ \'getPlayersInTeam\' [Expected team at argument 1, got boolean]
[2015-01-11 15:17:55] ERROR: phone-system/s_hotlines.lua:30: bad argument #1 to \'ipairs\' (table expected, got boolean)
[2015-01-11 15:17:58] WARNING: phone-system/s_hotlines.lua:30: Bad argument @ \'getPlayersInTeam\' [Expected team at argument 1, got boolean]
[2015-01-11 15:17:58] ERROR: phone-system/s_hotlines.lua:30: bad argument #1 to \'ipairs\' (table expected, got boolean)
És még jött egy új is:
[2015-01-11 15:17:41] Resource \'phone-system\' changed, reloading and starting
[2015-01-11 15:17:41] WARNING: phone-system/c_phone_system.lua [Client] is encoded in ANSI instead of UTF-8. Please convert your file to UTF-8.
[2015-01-11 15:17:41] Some files in \'phone-system\' use deprecated functions.
[2015-01-11 15:17:41] Use the \'upgrade\' command to perform a basic upgrade of resources.
Ahhoz hogy a második hibát kijavítsd váltsd át a c_phone_system.lua kódolását UTF-8-ba. Ezt úgy tudod megtenni hogy Notepad++ -ban legördíted a Kódolás menüsort és kiválasztod az \"UTF-8 kódolás BOM nélkül\" opciót.
Aztán ha ez megvan beírod az MTA Server.cmd-be, tehát a szerver konzolba a következőt: upgrade phone-system.
Az első hiba kijavítása érdekében próbáld meg azt hogy kicseréled a mostani ezzel megegyező részt ezzel:
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"Los Santos Police Department\" ) ) ) do
if getTeamFromName( \"Los Santos Police Department\" ) then
table.insert(playerStack, value)
end
end
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"State Police\" ) ) ) do
if getTeamFromName( \"State Police\" ) then
table.insert(playerStack, value)
end
end
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"Los Santos Medical Services\" ) ) ) do
if getTeamFromName( \"Los Santos Medical Services\" ) then
table.insert(playerStack, value)
end
end
for key, value in ipairs( getPlayersInTeam( getTeamFromName( \"Los Santos Fire Department\" ) ) ) do
if getTeamFromName( \"Los Santos Fire Department\" ) then
table.insert(playerStack, value)
end
end
for k,v in ipairs(getElementsByType(\"player\")) do
if getElementData(v, \"faction\") == 1 then
outputChatBox(\"Bejelentés jött vazze!\", v)
end
end