[Lua] Plate Text

 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
local memory = require 'memory'
local ffi = require 'ffi'
function sampSetLicensePlateText(id, text)
local vehpool = sampGetVehiclePoolPtr()
if memory.getuint8(vehpool + 0x3074 + id * 4) == 1 then
local this = ffi.cast('void*', memory.getuint32(vehpool + 0x1134 + id * 4))
ffi.cast('void(__thiscall*)(void*this, const char* text)', sampGetBase() + 0xB1BF0)(this, ffi.cast('char*', text))
end
end
function sampGetLicensePlateText(id)
local vehpool = sampGetVehiclePoolPtr()
if memory.getuint8(vehpool + 0x3074 + id * 4) == 1 then
local this = memory.getuint32(vehpool + 0x1134 + id * 4)
return memory.tostring(this + 0x93)
end
end
if isCharInAnyCar(playerPed) then
local car = storeCarCharIsInNoSave(playerPed)
local res, id = sampGetVehicleIdByCarHandle(car)
if res then
print(id)
print(sampGetLicensePlateText(id))
end
end