#include samp.ahk
IniRead, TagRadioR, %A_ScriptDir%\settings.ini, config, TagRadioR
IniRead, TagRadioF, %A_ScriptDir%\settings.ini, config, TagRadioF
IniRead, R, %A_ScriptDir%\settings.ini, function, R
IniRead, F, %A_ScriptDir%\settings.ini, function, F
CommandProcessor := new CommandProcessor()
CommandProcessor.SetStatusProcessor(true)
CommandProcessor.RegisterCommand("/r", "kp")
CommandProcessor.RegisterCommand("/f", "kp")
CommandProcessor.RegisterCommand("/bb", "kp")
AntiCrash()
kp:
chatInput := CommandProcessor.TempText
SendChat:
if (RegExMatch(chatInput, "^/r")) {
if (RegExMatch(chatInput, "^/r (.*)", out)) {
if (TagRadioR = "") or (R = 0) {
SendChat("/r " out1)
} else SendChat("/r [" TagRadioR "]: " out1)
} else AddChatMessageEx("cecfce","Используйте: /r [Текст].")
}
else if (RegExMatch(chatInput, "^/f")) {
if (RegExMatch(chatInput, "^/f (.*)", out)) {
if (TagRadioF = "") or (F = 0) {
SendChat("/f " out1)
} else SendChat("/f [" TagRadioF "]: " out1)
} else AddChatMessageEx("cecfce","Используйте: /f [Текст].")
}
else if (chatInput == "/bb") {
metka:
{
if (R = 0) {
textR = {6495ED}Вкл/Выкл тэг рации вольный R:`t{E21F1F}[Disabled]
}
if (R = 1) {
textR = {6495ED}Вкл/Выкл тэг рации вольный R:`t{32C13E}[Enabled]
}
if (F = 0) {
textF = {6495ED}Вкл/Выкл тэг рации вольный F:`t{E21F1F}[Disabled]
}
if (F = 1) {
textF = {6495ED}Вкл/Выкл тэг рации вольный F:`t{32C13E}[Enabled]
}
ShowDialog(4, "{6495ED}Настройки скрипта | Автор: {9D633A}Lucifer Melton", "{6495ED}Изменить тэг рации вольный R:`t{32C13E}[" TagRadioR "]`n" textR "`n `n{6495ED}Изменить тэг рации вольный F:`t{32C13E}[" TagRadioF "]`n" textF "`n `n{6495ED}Перезагрузить скрипт`n{6495ED}Полностью выключить скрипт", "{6495ED}Close Esc", "")
line := LineResult()
if (!line)
return
if (line == 1) {
showDialog(1, "{6495ED}Изменить тэг рации вольный R", "{F3F3F3}Введите Вашу тэг в поле ниже и нажмите {6495ED}Enter{F3F3F3}.", "{6495ED}Выбрать", "{6495ED}Назад")
while (isDialogOpen()) {
if (GetKeyState("Escape", "P") or (isDialogButtonSelected(2) = true and GetKeyState("LButton", "P"))) {
Gosub, metka
return
}
}
TagRadioR := readString(hGTA, dwSAMP + 0x12D8F8, 256)
IniWrite, %TagRadioR%, %A_ScriptDir%\settings.ini, config, TagRadioR
Gosub, metka
return
} else if (line == 2) {
if (R = 1) {
R = 0
IniWrite, 0, %A_ScriptDir%\settings.ini, function, R
Gosub, metka
return
}
if (R = 0) {
R = 1
IniWrite, 1, %A_ScriptDir%\settings.ini, function, R
Gosub, metka
return
}
} else if (line == 3) {
addChatMessageEx("cecfce", "А тут пусто")
goto, metka
return
} else if (line == 4) {
showDialog(1, "{6495ED}Изменить тэг рации вольный F", "{F3F3F3}Введите Вашу тэг в поле ниже и нажмите {6495ED}Enter{F3F3F3}.", "{6495ED}Выбрать", "{6495ED}Назад")
while (isDialogOpen()) {
if (GetKeyState("Escape", "P") or (isDialogButtonSelected(2) = true and GetKeyState("LButton", "P"))) {
Gosub, metka
return
}
}
TagRadioF := readString(hGTA, dwSAMP + 0x12D8F8, 256)
IniWrite, %TagRadioF%, %A_ScriptDir%\settings.ini, config, TagRadioF
Gosub, metka
return
} else if (line == 5) {
if (F = 1) {
F = 0
IniWrite, 0, %A_ScriptDir%\settings.ini, function, F
Gosub, metka
return
}
if (F = 0) {
F = 1
IniWrite, 1, %A_ScriptDir%\settings.ini, function, F
Gosub, metka
return
}
} else if (line == 6) {
addChatMessageEx("cecfce", "А тут пусто")
goto, metka
return
} else if (line == 7) {
addChatMessageEx("cecfce", "Скрипт будет перезагружен.")
Sleep 200
showgametext("Reloaded", 500, 1)
Sleep 100
Reload
} else if (line == 8) {
ExitApp
}
}
return
}
return
F10::
{
addChatMessageEx("cecfce", "Скрипт будет перезагружен.")
Sleep 200
showgametext("Reloaded", 500, 1)
Sleep 100
Reload
}
return
~Enter::
if(CommandProcessor.StatusProcessor) {
if(IsChatActive()==1) {
blockChatInput()
while(IsChatActive()==1)
continue
unBlockChatInput()
TextChat := GetChatText()
if(SubStr(TextChat, 1, 1) = "/") {
InputCMD := StrSplit(TextChat, A_Space)
InputCMD := InputCMD[1]
CommandProcessor.TempCmd := InputCMD
CommandProcessor.TempText := TextChat
if(CommandProcessor.CommandArray.HasKey(InputCMD)) {
ClearTextDialog()
SetTimer, % CommandProcessor.CommandArray[InputCMD], -1
}
else
{
SendChat(TextChat)
ClearTextDialog()
}
}
else
{
if(TextChat != "") {
CommandProcessor.TempText := TextChat
SendChat(TextChat)
ClearTextDialog()
}
}
}
}
return