local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if valid and doesCharExist(ped) then
local result, id = sampGetPlayerIdByCharHandle(ped)
if result and isKeyDown(VK_I) then
sampSendChat(string.format("/invite %s", id) )
wait(500)
sampSendChat(string.format("/giverank %s 6", id) )
end