script_name('Версия 0.1')
script_author('Автор Ofreega')
script_description('rfam')
require "lib.moonloader"
local activated = true
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(2000) end
sampAddChatMessage('Автор скрипта Ofreega',0xFFFF00)
sampAddChatMessage('Активация скрипта /rfam',0xFFFF00)
sampRegisterChatCommand('rfam', function()
activated = not activated
end)
while true do wait(0)
if activated then
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 activated and id ~= sampGetPlayerIdByCharHandle(PLAYER_PED) and distance < 12.0 then
if id ~= myid then
sampSendChat('/faminvite '..tonumber(id))
end
end
end
end
end
end