void changeProxyState(ProxyState state, int result)
Событие, вызываемое при изменении состояния прокси.
Параметр | Описание |
---|---|
state |
Состояние прокси. |
result |
Номер ошибки. |
samp.on("changeProxyState", function(state, result)
if state == ProxyState.DISCONNECTED then
print("[RiProxy] Disconnected.")
elseif state == ProxyState.RECONNECTING then
print("[RiProxy] Reconnecting...")
elseif state == ProxyState.CONNECTING then
printf("[RiProxy] Connecting to %s...", samp.getProxyAddress())
elseif state == ProxyState.AUTHENTICATION then
print("[RiProxy] Authentication...")
elseif state == ProxyState.CONNECTED then
printf("[RiProxy] Connected to %s.", samp.getProxyAddress())
elseif state == ProxyState.UDP_ASSOCIATED then
print("[RiProxy] UDP associated.")
elseif state == ProxyState.ATTEMPT_FAILED then
printf("[RiProxy] Can't connect. Error code: %d.", result)
elseif state == ProxyState.RESULT then
if result ~= 1 then
print("[RiProxy] Server error:", result)
end
end
end)