- 326
- 15
- Версия SA-MP
-
- 0.3.7-R2
Lua:
function main()
while not isSampAvailable() do wait(100) end
while true do
wait(0)
local result, target = getCharPlayerIsTargeting(playerHandle)
if result then result, playerid = sampGetPlayerIdByCharHandle(target) end -- Если зажата пкм на игроке, то получаем ID.
if result and wasKeyPressed(VK_1) then -- Если зажата пкм и кнопка 1 на игроке, то...
print(playerid) -- Выводим nickname в консоль Sampfuncs.
end
То есть нажал пкм ,ид запомнился и можно было бы использовтаь в других функциях