script_name('Версия 0.1')
script_author('Автор Yamato_Menendez')
script_description('rfam')
local act = false
local ignored = {}
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(2000) end
sampAddChatMessage('Автор скрипта Yamato_Menendez', 0x73b461)
sampAddChatMessage('Активация скрипта /rheal', 0x73b461)
sampRegisterChatCommand('rheal', function()
act = not act
sampAddChatMessage(act and "[RFAM] {FFFFFF}Скрипт {73b461}включен" or "[RFAM] {FFFFFF}Скрипт {dc4747}выключен", 0x73b461)
end)
while true do
wait(0)
if act then
wait(2300)
for _, v in pairs(getAllChars()) do
local mx, my, mz = getCharCoordinates(PLAYER_PED)
local x, y, z = getCharCoordinates(v)
local result, id = sampGetPlayerIdByCharHandle(v)
local distance = getDistanceBetweenCoords3d(mx, my, mz, x, y, z)
if result and v ~= PLAYER_PED and distance < 5.0 and (not ignored[id] or os.time() - ignored[id] > 600) then
ignored[id] = os.time()
sampSendChat('/heal '.. id)
end
end
end
end
end