- 6
- 2
- Версия MoonLoader
- .026-beta
Код:
[16:36:52.997070] (error) GM-car: opcode '03C0' call caused an unhandled exception
stack traceback:
[C]: in function 'storeCarCharIsInNoSave'
C:\...\moonloader\gmccar.lua:37: in function <C:\...\moonloader\gmccar.lua:15>
[16:36:52.997070] (error) GM-car: Script died due to an error. (0E61B2A4)
Код:
require 'lib.moonloader'
local se = require 'lib.samp.events'
------------------------------------------------
local enabled_gm = false
activation = false
------------------------------------------------
function main()
repeat wait(0) until isSampAvailable()
sampAddChatMessage('{d000ff}| {ffffff}GM CAR работает! Активация: {d000ff}/gmcc', -1)
sampRegisterChatCommand('gmcc', gm_c)
while true do
wait(0)
if not isCharInAnyCar(PLAYER_PED) then
enabled_gm = false
end
if enabled_gm then
setCarProofs(storeCarCharIsInNoSave(playerPed), true, true, true, true, true)
end
if activation then
if isCharInAnyCar(playerPed) then
-- local carHundle = storeCarCharIsInNoSave('playerPed')
-- local hpcar = getCarHealth(carHundle) тоже ошибку выбивает
if getCarHealth(storeCarCharIsInNoSave('playerPed')) <= 1000 then
enabled_gm = true
end
if getCarHealth(storeCarCharIsInNoSave('playerPed')) > 1000 then
enabled_gm = false
end
end
end
end
end
function gm_c(arg)
activation = not activation
if activation then
sampAddChatMessage('{d000ff}| {ffffff}GM CAR ON!', -1)
else
sampAddChatMessage('{d000ff}| {ffffff}GM CAR OFF!', -1)
end
end