local directIni = 'shawtyglock.ini'
local mainIni = inicfg.load(inicfg.load({
HotKey = {
trade = encodeJson({nil})
}
}, directIni))
local ActiveTrade = {
v = decodeJson(mainIni.HotKey.trade)
}
bindTrade = rkeys.registerHotKey(ActiveTrade.v, true, function()
local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if valid and doesCharExist(ped) then
local result, id = sampGetPlayerIdByCharHandle(ped)
if result then
sampSendChat('/trade '..id)
end
end
end)
-- imgui
if imgui.HotKey("##10", ActiveTrade, tLastKeys, 75) then
rkeys.changeHotKey(bindTrade, ActiveTrade.v)
mainIni.HotKey.trade = encodeJson(ActiveTrade.v)
inicfg.save(mainIni, directIni)
end