- 238
- 32
Lua:
function main()
repeat wait(0) until isSampAvailable()
wait(-1)
end
function sampev.onSendTakeDamage(playerId, damage, weapon, bodypart)
lua_thread.create(function()
if wasKeyPressed(88) then
if playerId ~= nil and playerId ~= tonumber('65535') and weapon ~= nil and damage ~= nil then
local color = string.sub(string.format('%x', sampGetPlayerColor(playerId)), 3)
if color == 'ffff' or weapon == 34 then
hkill = true
damageplayer = sampGetPlayerNickname(playerId)
weaponinfo = 'Вооружённое нападение'
else
damageplayer = sampGetPlayerNickname(playerId)
hkill = false
if weapon == 0 or weapon == 46 then
if isCharModel(playerPed, 295) or isCharModel(playerPed, 287) or isCharModel(playerPed, 285) or isCharModel(playerPed, 179) or isCharModel(playerPed, 255) or isCharModel(playerPed, 191) or isCharModel(playerPed, 73) or isCharModel(playerPed, 61) or isCharModel(playerPed, 284) or isCharModel(playerPed, 283) or isCharModel(playerPed, 282) or isCharModel(playerPed, 281) or isCharModel(playerPed, 280) or isCharModel(playerPed, 265) or isCharModel(playerPed, 266) or isCharModel(playerPed, 267) or isCharModel(playerPed, 309) or isCharModel(playerPed, 310) or isCharModel(playerPed, 311) or isCharModel(playerPed, 300) or isCharModel(playerPed, 301) or isCharModel(playerPed, 302) or isCharModel(playerPed, 286) or isCharModel(playerPed, 165) or isCharModel(playerPed, 166) then
weaponinfo = 'Нападение на сотр. ПО'
else
weaponinfo = 'Нападение на гражд. лицо'
end
else
weaponinfo = 'Вооружённое нападение'
end
end
playerId = nil
damage = nil
end
end
end)
end
Что тут не так? Туда ли впихнул if waskeypressed...?