- Dokumentacja
- Funkcje wspólne
- hasElementData
Funkcja
hasElementData
Sprawdza, czy element ma ustawioną wartość pod kluczem. W odróżnieniu od getElementData odróżnia brak wartości od false.
Składnia
bool hasElementData(element theElement, string key)Argumenty
theElementelement- Element.
keystring- Klucz.
Różnice względem MTA:SA
- Tych argumentów z MTA:SA tu nie ma:
bool inherit = true
W MTA:SA
hasElementData(element theElement, string key, bool inherit = true)Zwraca
true, jeśli klucz istnieje.
Przykład
if not hasElementData(player, "level") then
setElementData(player, "level", 1)
end