- 3
- 0
- Версия MoonLoader
- .026-beta
Всем привет, нужна помощь, т.к тот код занимает слишком много места и выглядит ужасно. Помогите, пожалуйста, если знаете как сократить.
говнокод:
function main()
repeat wait(0) until isSampAvailable()
_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickname(id)
sampAddChatMessage("[Mafia Helper] {FFFFFF} Начинаю проверку на сервер...", main_color)
while true do wait(1)
if sampIsLocalPlayerSpawned() and not spawned then
local ip, port = sampGetCurrentServerAddress()
if ip == "185.169.134.3" then
gameServer = "Arizona Role Play | Phoenix"
srv = 1
elseif ip == "185.169.134.4" then
gameServer = "Arizona Role Play | Tucson"
srv = 1
elseif ip == "185.169.134.43" then
gameServer = "Arizona Role Play | Scottdale"
srv = 1
elseif ip == "185.169.134.44" then
gameServer = "Arizona Role Play | Chandler"
srv = 1
elseif ip == "185.169.134.45" then
gameServer = "Arizona Role Play | Brainburg"
srv = 1
elseif ip == "185.169.134.5" then
gameServer = "Arizona Role Play | Saint-Rose"
srv = 1
elseif ip == "185.169.134.59" then
gameServer = "Arizona Role Play | Mesa"
srv = 1
elseif ip == "185.169.134.61" then
gameServer = "Arizona Role Play | Red-Rock"
srv = 1
elseif ip == "185.169.134.107" then
gameServer = "Arizona Role Play | Yuma"
srv = 1
elseif ip == "185.169.134.109" then
gameServer = "Arizona Role Play | Surprise"
srv = 1
elseif ip == "185.169.134.166" then
gameServer = "Arizona Role Play | Prescott"
srv = 1
elseif ip == "185.169.134.171" then
gameServer = "Arizona Role Play | Glendale"
srv = 1
elseif ip == "185.169.134.172" then
gameServer = "Arizona Role Play | Kingman"
srv = 1
elseif ip == "185.169.134.173" then
gameServer = "Arizona Role Play | Winslow"
srv = 1
elseif ip == "185.169.134.174" then
gameServer = "Arizona Role Play | Payson"
srv = 1
elseif ip == "80.66.82.191" then
gameServer = "Arizona Role Play | Gilbert"
srv = 1
elseif ip == "80.66.82.190" then
gameServer = "Arizona Role Play | Show-Low"
srv = 1
elseif ip == "80.66.82.188" then
gameServer = "Arizona Role Play | Casa-Grande"
srv = 1
elseif ip == "80.66.82.168" then
gameServer = "Arizona Role Play | Page"
srv = 1
elseif ip == "80.66.82.159" then
gameServer = "Arizona Role Play | Sun-City"
srv = 1
elseif ip == "80.66.82.200" then
gameServer = "Arizona Role Play | Queen-Creek"
srv = 1
elseif ip == "80.66.82.144" then
gameServer = "Arizona Role Play | Sedona"
srv = 1
elseif ip == "80.66.82.132" then
gameServer = "Arizona Role Play | Holiday"
srv = 1
elseif ip == "80.66.82.128" then
gameServer = "Arizona Role Play | Wednesday"
srv = 1
else
print("Данный скрипт, работает только на серверах Arizona Role Play.")
sampAddChatMessage("[Mafia Helper] {FFFFFF} К сожалению, данный скрипт недоступен для работы на данном сервере.", main_color)
sampAddChatMessage("[Mafia Helper] {FFFFFF} Свяжитесь с разработчиками, если хотите уточнить возможность решения данной проблемы.", main_color)
thisScript():unload()
return
end
spawned = true
sampAddChatMessage("[Mafia Helper] {FFFFFF}Проверка на сервер пройдена, сейчас Вы на ".. main_color_text ..tostring(gameServer), main_color)
sampAddChatMessage('[Mafia Helper] {FFFFFF}Привет, {f5cea4}' .. nick .. '{FFFFFF}! Для активации используй ' .. activation, main_color)
sampAddChatMessage("[Mafia Helper] {FFFFFF}Версия скрипта: {86d934}" .. script_version, main_color)
end
end
end