local hook require samp events local encoding require encoding encodin

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
local hook = require 'samp.events'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local hitId = nil
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("fd", function(param)
local id = tonumber(param)
local isConnected = sampIsPlayerConnected(id)
if isConnected then
local name = sampGetPlayerNickname(id)
printMessage(string.format("Начат поиск игрока %s[%d].", name, id))
end
end)
sampRegisterChatCommand("fdoff", function(param)
printMessage("Поиск завершен.")
end)
while true do
wait(0)
end
end
function hook.onSendBulletSync(data)
local id = data.targetId
local isExist, ped = sampGetCharHandleBySampPlayerId(id)
if isExist and doesCharExist(ped) and hitId ~= nil and id ~= hitId then -- ���� ��� ���������� � �� �� ����� ����, ������� ���� �����
return false -- �� ����� �� ��������
end
return data
end
function printMessage(msg)
local prefix = "{0282fa}[PlayerFind]{FFFFFF}"
sampAddChatMessage(string.format("%s %s", prefix, msg), 0xFFFFFF)
end
function hook.onSendGiveDamage(playerId, damage, weapon, bodypart)
local isExist, ped = sampGetCharHandleBySampPlayerId(playerId)
if isExist and doesCharExist(ped) and hitId ~= nil and playerId ~= hitId then
return false
end
return {playerId, damage, weapon, bodypart}
end
function hook.onPlayerStreamIn(playerId, team, model, position, rotation, color, fightingStyle)
if playerId == hitId then
local name = sampGetPlayerNickname(playerId)
printMessage(string.format("Игрок %s[%d] найден. Местоположение указано на карте.", name, playerId))
end
return {playerId, team, model, position, rotation, color, fightingStyle}
end
function hook.onPlayerStreamOut(playerId)
if playerId == hitId then
printMessage("Игрок куда-то пропал. Поиск возобновляется.")
end
return playerId
end
function hook.onPlayerDeath(playerId)
if playerId == hitId then
printMessage("Игрок убит. Поиск возобновляется.")
end
return playerId
end