if isKeyDown(VK_RBUTTON) then
if isKeyJustPressed(VK_MENU) then
local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if result and doesCharExist(ped) then
local success, id = sampGetPlayerIdByCharHandle(ped)
if success then
local pname = sampGetPlayerNickname(id)
local pscore = sampGetPlayerScore(id)
Player_ID = id
sampAddChatMessage('Вы начали взаимодействие с игроком: '..pname..' ('.. Player_ID .. ')', -1)
end
end
end
end
А если я хочу вставить туда /invite id куда это вставлять?
if isKeyDown(VK_RBUTTON) then
if isKeyJustPressed(VK_MENU) then
local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if result and doesCharExist(ped) then
local success, id = sampGetPlayerIdByCharHandle(ped)
if success then
local pname = sampGetPlayerNickname(id)
local pscore = sampGetPlayerScore(id)
Player_ID = id
sampAddChatMessage('Вы начали взаимодействие с игроком: '..pname..' ('.. Player_ID .. ')', -1)
sampSendChat("/invite " .. Player_ID)
end
end
end
end
Lua:if isKeyDown(VK_RBUTTON) then if isKeyJustPressed(VK_MENU) then local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE) if result and doesCharExist(ped) then local success, id = sampGetPlayerIdByCharHandle(ped) if success then local pname = sampGetPlayerNickname(id) local pscore = sampGetPlayerScore(id) Player_ID = id sampAddChatMessage('Вы начали взаимодействие с игроком: '..pname..' ('.. Player_ID .. ')', -1) sampSendChat("/invite " .. Player_ID) end end end end
Работает. Просто ты не поставил в цикл.Не работает Мирон
Актуально.
while true do wait(0)
if isKeyDown(VK_RBUTTON) then
if isKeyJustPressed(VK_MENU) then
local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE)
if result and doesCharExist(ped) then
local success, id = sampGetPlayerIdByCharHandle(ped)
if success then
local pname = sampGetPlayerNickname(id)
local pscore = sampGetPlayerScore(id)
Player_ID = id
sampAddChatMessage('Вы начали взаимодействие с игроком: '..pname..' ('.. Player_ID .. ')', -1)
sampSendChat("/invite " .. Player_ID)
end
end
end
end
end
Про либу Vkeys ничего ты не написал)Работает. Просто ты не поставил в цикл.
Lua:while true do wait(0) if isKeyDown(VK_RBUTTON) then if isKeyJustPressed(VK_MENU) then local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE) if result and doesCharExist(ped) then local success, id = sampGetPlayerIdByCharHandle(ped) if success then local pname = sampGetPlayerNickname(id) local pscore = sampGetPlayerScore(id) Player_ID = id sampAddChatMessage('Вы начали взаимодействие с игроком: '..pname..' ('.. Player_ID .. ')', -1) sampSendChat("/invite " .. Player_ID) end end end end end
P.S. Тестировал, всё должно работать. (ПКМ + Alt)
ИмеетсяПро либу Vkeys ничего ты не написал)
Все равно не работает почему тоРаботает. Просто ты не поставил в цикл.
Lua:while true do wait(0) if isKeyDown(VK_RBUTTON) then if isKeyJustPressed(VK_MENU) then local result, ped = getCharPlayerIsTargeting(PLAYER_HANDLE) if result and doesCharExist(ped) then local success, id = sampGetPlayerIdByCharHandle(ped) if success then local pname = sampGetPlayerNickname(id) local pscore = sampGetPlayerScore(id) Player_ID = id sampAddChatMessage('Вы начали взаимодействие с игроком: '..pname..' ('.. Player_ID .. ')', -1) sampSendChat("/invite " .. Player_ID) end end end end end
P.S. Тестировал, всё должно работать. (ПКМ + Alt)
Все я сделал,прост не подключил библиотеку.Скрипт сам работает? А то он может крашиться маленько погодя)?
И важно чтобы ты наводил пкм на игрока(не бота) и нажимал