function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("iall",function()
checkplayes = {}
if arg and arg:find("^%d+$") and tonumber(arg) > 0 and tonumber(arg) < 26 then
for k,v in pairs(getAllChars()) do
local x,y,z = getCharCoordinates(v)
local positionX, positionY, positionZ = getCharCoordinates(PLAYER_PED)
local dist = getDistanceBetweenCoords3d(positionX, positionY, positionZ,x,y,z)
if dist <= tonumber(arg) and v ~= 1 then
res, id = sampGetPlayerIdByCharHandle(v)
if res then
name = sampGetPlayerNickname(id)
table.insert(checkplayes,name)
end
end
end
if #checkplayes < 1 then
sampAddChatMessage("Рядом с вами нету людей!",-1)
else
for k, v in pairs(checkplayes) do
sampSendChat("/faminvite "..v)
end
end
else
sampAddChatMessage("Используйте /iall [Radius 1-25]",-1)
end
end)
wait(-1)
end