SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Funkcje serwera
  3. startResource

Funkcja

startResource

Uruchamia zatrzymany zasób. Zasób wczytuje skrypty, mapy i pliki, a gracze go pobierają.

Składnia

bool startResource(resource theResource)

Argumenty

theResourceresource
Zasób (uchwyt albo nazwa).

Różnice względem MTA:SA

  • Tych argumentów z MTA:SA tu nie ma: bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true

W MTA:SA

startResource(resource resourceToStart, bool persistent = false, bool startIncludedResources = true, bool loadServerConfigs = true, bool loadMaps = true, bool loadServerScripts = true, bool loadHTML = true, bool loadClientConfigs = true, bool loadClientScripts = true, bool loadFiles = true)

Zwraca

true, gdy zasób wystartował.

Przykład

addCommandHandler("start", function(player, _, name)
    if hasObjectPermissionTo(player, "command.start") then
        startResource(getResourceFromName(name or ""))
    end
end)

Zobacz też