- Dokumentacja
- Funkcje wspólne
- getPlayerWaypoint
Funkcja
getPlayerWaypoint
Zwraca punkt GPS gracza, czyli cel, który zaznaczył na mapie albo ustawił skrypt. Na serwerze to ostatni punkt potwierdzony przez grę gracza.
Składnia
Serwer
float, float getPlayerWaypoint(player thePlayer)Klient
float, float getPlayerWaypoint()Argumenty
thePlayerplayer- Gracz (tylko na serwerze).
Zwraca
x, y albo false, gdy gracz nie ma celu.
Przykład
addCommandHandler("cel", function(player)
local x, y = getPlayerWaypoint(player)
if x then
outputChatBox(string.format("Twój cel: %.0f, %.0f", x, y), player)
else
outputChatBox("Nie masz celu na mapie.", player)
end
end)
Zobacz też
setPlayerWaypointUstawia graczowi punkt GPS gry: cel na radarze i mapie, a w pojeździe także trasę po drogach. Grę potwierdza zdarzeniemonPlayerWaypointSet.removePlayerWaypointZdejmuje graczowi punkt GPS.onPlayerWaypointSetGracz ma nowy znacznik GPS gry (potwierdzony przez jego grę): postawiony prawym kliknięciem na mapie ESC albo skryptem.