function main()
repeat wait(0) until isSampAvailable()
sampRegisterChatCommand('inn', function()
for _,v in pairs(getAllChars()) do
if v ~= PLAYER_PED and doesCharExist(v) then
local _,id = sampGetPlayerIdByCharHandle(v)
if not sampIsPlayerNpc(id) and sampGetPlayerScore(id) ~= 0 then
local x,y,z = getCharCoordinates(v)
local pX,pY,pZ = getCharCoordinates(PLAYER_PED)
if getDistanceBetweenCoords3d(x,y,z,pX,pY,pZ) < 12 then
sampSendChat('/faminvite ' .. id)
end
end
end
end
end)
wait(-1)
end