script_name('Версия 0.1')
script_author('Автор Adam_Karleone')
script_description('rfam')
require "lib.moonloader"
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(2000) end
sampAddChatMessage('Автор скрипта Adam_Karleone',0xFFFF00)
sampAddChatMessage('Активация скрипта /rfam',0xFFFF00)
sampRegisterChatCommand('rfam', rfam)
while true do
wait(0)
end
end
function rfam()
local peds = getAllChars()
for _, v in pairs(peds) do
local result, myid = sampGetPlayerIdByCharHandle(playerPed)
local mx, my, mz = getCharCoordinates(playerPed)
local x, y, z = getCharCoordinates(v)
local distance = getDistanceBetweenCoords3d(mx, my, mz, x, y, z)
local result, id = sampGetPlayerIdByCharHandle(v)
if result and id ~= sampGetPlayerIdByCharHandle(PLAYER_PED) and distance < 12.0 then
if id ~= myid then
sampSendChat('/faminvite '..tonumber(id))
end
end
end
end