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