function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
act = 0
sampRegisterChatCommand("test", funcact)
while true do
wait (0)
if act == 1 then
for k, v in pairs(getAllChars()) do
_, id = sampGetPlayerIdByCharHandle(v)
_, Pid = sampGetPlayerIdByCharHandle(PLAYER_PED)
if Pid ~= id then
x, y, z = getCharCoordinates(v)
xp, yp, zp = getCharCoordinates(PLAYER_PED)
distant = getDistanceBetweenCoords3d(x,y,z,xp,yp,zp)
if distant <= 10.0 then
sampAddChatMessage("Рядом игрок "..id, -1)
end
end
end
end
end
end
function funcact()
if act == 0 then
act = 1
sampAddChatMessage("Включено", -1)
else
act = 0
sampAddChatMessage("Выключено", -1)
end
end