function getSelectedPlayerNametagText ()
name = guiGridListGetItemText(gridlist2, guiGridListGetSelectedItem(gridlist2), 2)
end
function getPlayerFromNametagText ()
getPlayerFromName (guiGridListGetItemText(gridlist2, guiGridListGetSelectedItem(gridlist2), 2))
end
function tppl ()
local plname = getSelectedPlayerNametagText()
if not plname then
outputChatBox ("Ошибка")
end
local pl = getPlayerFromNametagText(plname)
local car = getPedOccupiedVehicle(localPlayer)
if car then
outputChatBox("Игрок в авто, вы не можете телепортироваться в авто", 255, 0, 0)
end
if not pl then return outputChatBox("Игрока нет.") end
local x, y, z = getElementPosition(pl)
setElementPosition(localPlayer, x, y, z)
outputChatBox("Вы были телепортированы к игроку "..getPlayerNametagText(pl))
end
Вот код. При его запуске выдает в чат "Ошибку" и соответсвенно "Игрока нет"