Jump to content

Alexey0402

Members
  • Posts

    34
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Alexey0402's Achievements

Rat

Rat (9/54)

0

Reputation

  1. Я так понял, когда форма одежды одна и таже, то шейдером цвет одежды просто меняешь. А когда форма одежды другая, то уже модельку делать. Можешь скинуть гайд, как работать с шейдерами? А то я не могу найти хороший гайд. Просто долгое время с Samp работал.
  2. Как сделать подобное? Я так понял это скины? Или как-то иначе можно всё сделать?
  3. Hello guys! I'm sorry for my bad English, but I'm Russian. I have a problem. For the Library string any Russian symbol is two symbols. For example: Code: outputDebugString(tostring(string.len("кекс")) In logs: 8 The second example: Code: outputDebugString(tostring(string.len("кекс1и к")) In logs: 14 It is the cause of many difficulties, when I'm working with the library string. I will must count every Russian symbol if I want to use the library string. When I want to use automatical function to work with the library, it is the hell. Example: I want to print the first six symbols. ("Яы5 бю") Now I can't do it automatical. I must do it by hand. Code: outputDebugString(string.sub("Яы5 бю ядовит",1, 10)) How I was thinking: The first symbol is "Я". It is Russian symbol The second symbol is "ы". It is Russian symbol The third symbol is "5". It is not Russian symbol The fourth symbol is " ". It is not Russian symbol The fifth symbol is "б". It is Russian symbol The sixth symbol is "ю". It is Russian symbol In total, there are 4 Russian symbols and 2 other symbols. 4*2 + 2 is 10. It's bored. Please, say me how can I fix it? I want Russian symbol to be 1 symbol too.
  4. blabla вне области видимости получилось, надо было объявить переменную ранее. local bar; -- объявили переменную bar function foo( ... ) return bar( ... ) -- она будет в области видимости данной функции end -- установить для переменной bar функцию -- переменная останется при этом локальной function bar( ... ) return true end foo() Спасибо большое.
  5. I have found a solution. I use focusBrowser(nil) . All is good. One problem less. There is only the problem with the label now.
  6. Unfortunately, your suggestion did not help me. It does not work.
  7. How can I unbind "backspace"? I've found one thing. "shift + backspace" go you forward (to next page). I can use it, but it is strange method. (and user will understand that its page will have restarted)
  8. About the second problem. I have understood. Browser did not stop. "backspace" is button which has the effect to go back (on previous page). How can I forbid to go back on previous page?
  9. Probably, I incorrect tell about the first problem. Full code: errorW = {} -- this is in the top of the script function whenServerSendWrongAfterFirstPart(x) if(x == 1) then showErrorGui("К сожалению, такой логин уже занят. Пожалуйста, придумайте другой логин.") elseif(x == 2) then showErrorGui("Логин может состоять только из букв английского алфавита (латиница) и цифр, а также логин должен быть не менее 6 и не более 32 символов.") elseif(x == 3) then showErrorGui("Пароль может состоять только из букв английского алфавита (латиница) и цифр, а также пароль должен быть не менее 8 и не более 64 символов.") elseif(x == 4) then showErrorGui("Адрес электронной почты может состоять только из букв английского алфавита (латиница), цифр и следующих символов: .@_- .Также адрес электронной почты должен быть не менее 2 и не более 64 символов.") elseif(x == 5) then showErrorGui("Номер телефона может состоять только из цифр, знака плюс ('+') , а также номер телефона должен быть не менее 2 и не более 32 символов.") end end function showErrorGui(errorString) errorW.window = guiCreateWindow(0, 0, 1.0, 1.0, "Внимание!", true) guiBringToFront(errorW.window) errorW.label = guiCreateLabel(0, 0, 1.0, 1.0, errorString, true, errorW.window) errorW.button = guiCreateButton(0, 0, 1.0, 1.0, "Далее", true, errorW.window) guiSetFont(errorW.label, fonts.Registration) guiLabelSetHorizontalAlign(errorW.label, "left", true) local y = guiLabelGetFontHeight(errorW.label) local k = guiLabelGetTextExtent(errorW.label) local s = math.ceil(math.sqrt(k * y / 2.5) / y) local x = math.ceil(k / s) guiSetSize(errorW.window, x / 0.8, (y * s + (x / 0.8 * 0.6) / 3) / 0.85 + 0.01470588235 * height, false) guiSetSize(errorW.label, x, y * s, false) guiSetSize(errorW.button, x / 0.8 * 0.6, (x / 0.8 * 0.6) / 3, false) guiSetPosition(errorW.window, (width - x / 0. / 2, (height - (y * s + (x / 0.8 * 0.6) / 3) / 0.85) / 2, false) guiSetPosition(errorW.label, x / 0.8 * 0.1, (y * s + (x / 0.8 * 0.6) / 3) / 0.85 * 0.05 + 0.01470588235 * height, false) guiSetPosition(errorW.button, x / 0.8 * 0.2, (y * s + (x / 0.8 * 0.6) / 3) / 0.85 * 0.95 - (x / 0.8 * 0.6) / 3 + 0.01470588235 * height, false) guiWindowSetMovable(errorW.window, false) guiWindowSetSizable(errorW.window, false) end
  10. Hello world! I'm sorry for my bad English, but I am Russian. I haven't been helped on Russian part of forum. I have two serious problems. The first problem I have created a universal window to show notifications ("you have inputted the login that is busy" or "this menu is not available to you" etc). The window is a standart window centered on the screen. There are only a label and a button in the window. The label takes up most of the window. The button has one function. This function is closing the window. Because I am lazy, I do not want to find height and width the label, the window and the button. Therefore, depending on the size of a text (I find size of the text using guiLabelGetFontHeight and guiLabelGetTextExtent), I find size of the label. Then I find size of the button and size of the window. (All this is depends the size of the text). But there is a problem. I use guiLabelSetHorizontalAlign(errorW.label, "left", true) for line wrapping. But guiLabelGetTextExtent gets the size of a text without spaces, which guiLabelSetHorizontalAlign(errorW.label, "left", true) has created, when guiLabelSetHorizontalAlign(errorW.label, "left", true) made line wrapping. These spaces are reason of wrong set size of the label. I see two ways to solve the problem: 1. Tell me, how I can find out, how many pixels add to the height of the label, that a part of the text do not loses. 2. Or tell me, how I can make line wrapping. But do not transfer all word, but transfer part of a word (transfer letters, do letter-wrap). P.S. The size of a text I get so local y = guiLabelGetFontHeight(errorW.label) local k = guiLabelGetTextExtent(errorW.label) local s = math.ceil(math.sqrt(k * y / 2.5) / y) local x = math.ceil(k / s) -- the label has width = x and height = y * s The second problem. I have a problem with a browser. I created a browser. Then I created video as background of the browser. I attached children. All works good. But when I press "backspace" in a guiEdit, the browser stop. When I press "backspace" , when I am focussed on the browser, the browser stop. How I can fix it? If you do not understand me, ask me in the comments. I am sorry for my bad English. But I am tired of trying fix these problems. Help me, please.
  11. Люди, у меня есть два очень важных вопроса. ПОЖАЛУЙСТА, помогите мне с ними. 1. Сделал универсальное окно для выведения уведомлений (типо, вы ввели при регистрации тот логин, который занят уже/пытаетесь войти в то меню, в которое нельзя.). Обычное окошко (window) по средине экрана, где почти всё пространство (этого окна) занимает label, ну и одна button ещё есть в стиле "ок". Так вот, так как я ленивый человек, то адаптировать текст каждый раз не хочу. Поэтому в зависимости от размеров label (которые я нахожу через размер шрифта и размер текста) меняется window и button. И всё бы хорошо, но вот загвоздочка одна. Использую значит я guiLabelSetHorizontalAlign(errorW.label, "left", true), чтобы всё было не в одну строку. А косяк в том, что guiLabelGetTextExtent, которым я находил ПОЛНУЮ длину текста, не учитывает те пропуски, которые допускает guiLabelSetHorizontalAlign, когда слово не вмещается в строку. Из-за этих пропусков часто неверно считаются размеры. P.S. Подсчёт размеров делаю так local y = guiLabelGetFontHeight(errorW.label) local k = guiLabelGetTextExtent(errorW.label) local s = math.ceil(math.sqrt(k * y / 2.5) / y) local x = math.ceil(k / s) -- соответственно label имеет width = x и height = y * s Собственно как вы можете мне помочь. Я вижу два пути: 1. Расскажите как мне подсчитать сколько мне пикселей нужно добавить в размер height, чтобы часть текста не отсекалась. 2. Или расскажите как сделать перенос не слов, а БУКВ (то есть, чтобы слово разрывалось). !Проблема номер 2! Проблема с браузером. Создал gui браузер, поставил фоном видео, всё идеально. Прикрепил к браузеру деток, всё работает, но когда в поле edit нажимаешь backspace, то браузер закрывается или когда нажимаешь на фон (браузер, как фон)и нажимаешь backspace, то тоже браузер слетает. Посоветуйте как это пофиксить. ВНИМАНИЕ!!!! Если что-то не поняли, спрашивайте. Проблемы актуальные, никак решить их не могу.
  12. Расскажите про local function. Например почему здесь я "вызываю' глобальную функцию? Могу ли я вызвать blabla локально? local function RRClicked(button) if(button == "left") then blabla()--не выполнится, ибо blabla - локальная функция end local function blabla() end P.S. Из способов вызова локально знаю лишь создание и вызов eventа
×
×
  • Create New...