- 83
- 5
- Версия MoonLoader
- .027.0-preview
Есть вот такой вот объект и скрипт ниже
Возможно ли сделать так чтобы синрха отправлялась к этому объекту, а не в воздух? При условии что он вечно двигается
Возможно ли сделать так чтобы синрха отправлялась к этому объекту, а не в воздух? При условии что он вечно двигается
Lua:
script_name("skillmaster")
script_author("romacaddy")
local hyk = require 'lib.samp.events'
function main()
if not isSampLoaded() and isSampAvailable() then return end
while not isSampAvailable() do wait(0) end
sampfuncsRegisterConsoleCommand("sync", syncskill)
sampfuncsRegisterConsoleCommand("hook", hookskill)
while true do
wait(0)
if ss then
id = getCurrentCharWeapon(PLAYER_PED)
ammo = getAmmoInCharWeapon(PLAYER_PED, id)
if ammo == 1 then
ss = false
else
sendbullet()
ammo = ammo - 1
setCharAmmo(PLAYER_PED, id, ammo)
wait(100)
end
end
end
end
function sendfakesync()
--sendOnfootSync()
sendbullet()
--sampForceOnfootSync()
wait(150)
sendOnfootSync()
sampForceOnfootSync()
end
function sendOnfootSync()
local _, myId = sampGetPlayerIdByCharHandle(PLAYER_PED)
local data = allocateMemory(68)
sampStorePlayerOnfootData(myId, data)
setStructFloatElement(data, 6, 291, false)
setStructFloatElement(data, 10, -23, false)
setStructFloatElement(data, 14, 1017, false)
sampSendOnfootData(data)
freeMemory(data)
end
function syncskill()
ss = not ss
if ss then
sampfuncsLog("{00ffff}[SYNC.SKILL]: {ffffff}�����������")
else
sampfuncsLog("{00ffff}[SYNC.SKILL]: {ffffff}�������������")
end
end
function hookskill()
hh = not hh
if hh then
sampfuncsLog("{00ffff}[HOOK.SKILL]: {ffffff}�����������")
else
sampfuncsLog("{00ffff}[HOOK.SKILL]: {ffffff}�������������")
end
end
function sendbullet()
data = allocateMemory(40)
setStructElement(data, 0, 1, 3, false)
setStructElement(data, 1, 2, 111, false)
setStructFloatElement(data, 3, 292, false)
setStructFloatElement(data, 7, -18, false)
setStructFloatElement(data, 11, 1017, false)
setStructFloatElement(data, 15, 292, false)
setStructFloatElement(data, 19, -18, false)
setStructFloatElement(data, 23, 1017, false)
setStructFloatElement(data, 27, 1231230.012, false)
setStructFloatElement(data, 31, 1231230.023, false)
setStructFloatElement(data, 35, 1231230.0123, false)
local curweap = getCurrentCharWeapon(PLAYER_PED)
if curweap ~= 0 and curweap ~= 5 then
setStructElement(data, 39, 1, curweap, false)
sampSendBulletData(data)
end
freeMemory(data)
end
function hyk.onSendBulletSync(qwe)
if hh then
qwe.targetType = 3
qwe.targetId = 90
qwe.origin.x = 0
qwe.origin.y = 0
qwe.origin.z = 0
qwe.target.x = 0
qwe.target.y = 0
qwe.target.z = 0
qwe.center.x = 0
qwe.center.y = 0
qwe.center.z = 0
local curweap = getCurrentCharWeapon(PLAYER_PED)
if curweap == 24 or curweap == 25 or curweap == 30 or curweap == 31 or curweap == 29 then
qwe.weaponId = curweap
end
end
end