SA Memory

LUCHARE

Известный
Автор темы
Друг
545
699
Lua:
local samem = require 'SAMemory'
samem.require 'CWeaponEffects'

local cross = samem.crosshairs[0]
if cross ~= samem.nullptr then
    cross.bActive = true
    cross.fSize = 2
    cross.uiColor = 1828657947
    cross.nTimeWhenToDeactivate = 30000
end
Почему не получается изменить параметры?
в массиве samem.crosshairs есть несколько прицелов и возможно ты меняешь не тот
 
  • Вау
Реакции: imring

borsuczyna

Активный
29
148
Hello, question about SAMemory, how can get samem object by specified vehicle?
For example:
Lua:
local myCar = createCar(411, 0, 0, 3)
local veh = samem.memoryFromCar(myCar) -- something like this 
myCar.vMoveSpeed.z = 1
 

LUCHARE

Известный
Автор темы
Друг
545
699
Hello, question about SAMemory, how can get samem object by specified vehicle?
For example:
Lua:
local myCar = createCar(411, 0, 0, 3)
local veh = samem.memoryFromCar(myCar) -- something like this
myCar.vMoveSpeed.z = 1
Lua:
local myCar = createCar(411, 0, 0, 3);
if (doesVehicleExist(myCar)) then
    local myCarPtr = getCarPointer(myCar);
    local myVeh = samem.cast("CVehicle *", myCarPtr);
    -- *code*
else
    print("createCar(411, 0, 0, 3) failed");
end

-- OR

samem.require("CPool");
samem.require("CVehicle");

local vpool = samem.vehicle_pool;
if (vpool[0] ~= samem.nullptr) then
    local myCar = createCar(411, 0, 0, 3);
    if (vpool[0].is_valid_handle(myCar)) then
        local myVeh = vpool[0].get_ptr("CVehicle", myCar);
        -- *code*
    else
        print("createCar(411, 0, 0, 3) failed");
    end
else
    print("vehicle pool is not available");
end
 
  • Влюблен
Реакции: borsuczyna

borsuczyna

Активный
29
148
Hello, @LUCHARE can you help me with one more thing? I can read fSteerAngle but I can't change it, I tried like that:
Lua:
car.fSteerAngle = 0.5
but its still 0. What should I do?