-
Posts
25 -
Joined
-
Last visited
Everything posted by Mr.DeViLsS
-
function skins ( commandName ) -- cj_ped_head local textSkin = dxCreateTexture ( "img.png" ) local skin = dxCreateShader( "tex_names.fx", 0, 0, true, "ped" ) engineApplyShaderToWorldTexture ( skin, "cj_ped_head", localPlayer ); dxSetShaderValue ( skin, "texure0", textSkin ) end addCommandHandler ( "cSkin", skins ) Shader: // // tex_names.fx // float Time : TIME; // Make everything all flashy! float4 GetColor() { return float4( cos(Time*10), cos(Time*7), cos(Time*4), 1 ); } //----------------------------------------------------------------------------- // Techniques //----------------------------------------------------------------------------- technique tec0 { pass P0 { MaterialAmbient = GetColor(); MaterialDiffuse = GetColor(); MaterialEmissive = GetColor(); MaterialSpecular = GetColor(); AmbientMaterialSource = Material; DiffuseMaterialSource = Material; EmissiveMaterialSource = Material; SpecularMaterialSource = Material; ColorOp[0] = SELECTARG1; ColorArg1[0] = Diffuse; AlphaOp[0] = SELECTARG1; AlphaArg1[0] = Diffuse; Lighting = true; } } Please tell me, why not replace the texture? Result: https://imgur.com/a/vciyC Texture: https://imgur.com/a/VCcbO
-
function createFileHandler() local RootNode = xmlCreateFile("new.xml"," newroot") test_1 = xmlFindChild ( RootNode, "Test_1", 0 ) test_2 = xmlFindChild ( RootNode, "Test_2", 0 ) if test_1 == false then test_1 = xmlCreateChild ( RootNode, "Test_1", 0 ) end if test_2 == false then test_2 = xmlCreateChild ( RootNode, "Test_2", 0 ) end xmlNodeSetValue ( test_1, 10 ) xmlNodeSetValue ( test_2, 1 ) xmlSaveFile(RootNode) xmlUnloadFile(RootNode) end addCommandHandler("createfile", createFileHandler) function createFileHandler(commandName, param1, param2) local RootNode = xmlCreateFile("new.xml"," newroot") test = xmlFindChild ( RootNode, param1, 0 ) if test == false then test = xmlCreateChild ( RootNode, param1, 0 ) end xmlNodeSetValue ( test, param2 ) xmlSaveFile(RootNode) xmlUnloadFile(RootNode) end addCommandHandler("val", createFileHandler)
-
The text goes beyond the boundaries of the field.
-
Good time of day. Please tell me, how to implement this outline?
-
What I there should see? I need to when creating a field, the system is automatic clicks on the field itself. So what would I hadn't clicked on edit box it to for enter text
-
Hi. How to make a field active immediately after the show? So to be able to enter text immediately, not after clicking
-
Thanks for the answer.
-
Hi. Prompt me please. If use the 'executeCommandHandler' on the server side - the command will be compared with those that have been created on the server side?
-
elementGUI.scrollBar = guiCreateScrollBar ( 0.02, 0.85, 0.96, 0.04, true, true, elementGUI.window ) guiSetProperty ( elementGUI.scrollBar, "StepSize", 0.01 ) How to make the scroll range was from 0 to 3, for example. Or from 0 to 6
-
Почему не работает "HorzRange в guiSetProperty?
-
Why doesn't works "HorzRange in guiSetProperty?
-
Hi. Please tell me how to make the range for the ScrollBar. For example, to the slider was only from 0 to 3, for example.
-
Подскажите пожалуйста. Как сделать, чтобы скрол был, например от 0 до 3 (чтобы при прокрутки было 0, 1, 2, 3)?
-
Подскажите пожалуйста, как сделать, чтобы при написании в чат, старые строки "уезжали" вверх. if isChatVisible ( ) then showChat ( false ) end local chatStatus = true local EnterMessGUI local sW, sH = guiGetScreenSize ( ) local chatHistory = { } addEventHandler ( "onClientRender", getRootElement(), function ( ) if not chatStatus then return end if EnterMessGUI then dxDrawRectangle ( sW/2-sW/2+8, sH/2+320, 771, 24, tocolor ( 42, 42, 42, 200 ) ) dxDrawText ( guiGetText ( EnterMessGUI ), sW/2-sW/2+15, sH/2+323, 771, 24, tocolor ( 255,255,255,255 ), 1, "Segoe Ui" ) end -- sY = 0 -- for i = 1, #chatHistory do dxDrawText ( chatHistory [ i ] [ 2 ].. ": ", sW/2-sW/2 + 30, sH/2 + sY, 150, 30, tocolor ( 224,224,224,255), 1.05, "default-bold" ) -- вывод ника wn = dxGetTextWidth ( chatHistory [ i ] [ 2 ]..": ", 1.05, "default-bold" ) dxDrawText ( chatHistory [ i ] [ 1 ], sW/2-sW/2 + 30 + wn, sH/2+sY, 150, 30, tocolor ( 224,224,224,255), 1.05, "default-bold" ) -- вывод сообщения sY = sY + 20 end -- -- -- end ) local EnterMess = false bindKey ( "t", "down", function ( ) if not EnterMess and chatStatus then EnterMessGUI = guiCreateEdit ( sW/2-sW/2+8, sH/2+320, 771, 24, "", false) guiSetAlpha ( EnterMessGUI, 0.00 ) guiEditSetMaxLength ( EnterMessGUI, 100 ) EnterMess = true showCursor ( true ) guiBringToFront ( EnterMessGUI ) setTimer ( function ( ) guiSetText ( EnterMessGUI, "" ) end, 50, 1 ) end end ) addEventHandler ( "onClientKey", root, function ( key, press ) if not press then return end if EnterMess then if key == "enter" then -- showCursor ( false ) EnterMess = false text = guiGetText ( EnterMessGUI ) destroyElement ( EnterMessGUI ) EnterMessGUI = nil if text == "" or text == " " then return end table.insert ( chatHistory, { text, "Mr" } ) -- end end )
-
Подскажите пожалуйста, как сделать, чтобы при написании в чат, старые строки "уезжали" вверх. if isChatVisible ( ) then showChat ( false ) end local chatStatus = true local EnterMessGUI local sW, sH = guiGetScreenSize ( ) local chatHistory = { } addEventHandler ( "onClientRender", getRootElement(), function ( ) if not chatStatus then return end if EnterMessGUI then dxDrawRectangle ( sW/2-sW/2+8, sH/2+320, 771, 24, tocolor ( 42, 42, 42, 200 ) ) dxDrawText ( guiGetText ( EnterMessGUI ), sW/2-sW/2+15, sH/2+323, 771, 24, tocolor ( 255,255,255,255 ), 1, "Segoe Ui" ) end -- sY = 0 -- for i = 1, #chatHistory do dxDrawText ( chatHistory [ i ] [ 2 ].. ": ", sW/2-sW/2 + 30, sH/2 + sY, 150, 30, tocolor ( 224,224,224,255), 1.05, "default-bold" ) -- вывод ника wn = dxGetTextWidth ( chatHistory [ i ] [ 2 ]..": ", 1.05, "default-bold" ) dxDrawText ( chatHistory [ i ] [ 1 ], sW/2-sW/2 + 30 + wn, sH/2+sY, 150, 30, tocolor ( 224,224,224,255), 1.05, "default-bold" ) -- вывод сообщения sY = sY + 20 end -- -- -- end ) local EnterMess = false bindKey ( "t", "down", function ( ) if not EnterMess and chatStatus then EnterMessGUI = guiCreateEdit ( sW/2-sW/2+8, sH/2+320, 771, 24, "", false) guiSetAlpha ( EnterMessGUI, 0.00 ) guiEditSetMaxLength ( EnterMessGUI, 100 ) EnterMess = true showCursor ( true ) guiBringToFront ( EnterMessGUI ) setTimer ( function ( ) guiSetText ( EnterMessGUI, "" ) end, 50, 1 ) end end ) addEventHandler ( "onClientKey", root, function ( key, press ) if not press then return end if EnterMess then if key == "enter" then -- showCursor ( false ) EnterMess = false text = guiGetText ( EnterMessGUI ) destroyElement ( EnterMessGUI ) EnterMessGUI = nil if text == "" or text == " " then return end table.insert ( chatHistory, { text, "Mr" } ) -- end end )
-
Спасибо
-
Подскажите пожалуйста. Как сделать отсчет времени (сколько секунд осталось) до конца таймера? setTimer ( function ( ) -- end , 600000, 1 ) Вот как узнать сколько секунд осталось до срабатывания?
-
Спасибо, помогло.
-
Подскажите пожалуйста. Почему вместо русского текста, пишутся знаки вопрос ("???") ? кодировка таблицы - utf32_general_ci .lua - UTF8 (без BOM) dxDrawText( tostring( text ), sx + 2, sy + 2, sx, sy, tocolor( 0, 0, 0, 255 ), 1, "default", "center", "center" )
-
Ответ кто нибудь даст?
-
Как я понял, при нажатие на кнопку - показываем GUI, а как вот сделать прокрутку?
-
Подскажите пожалуйста, как сделать прокрутку и ввод текст в чат. Как в samp. http://i.imgur.com/xoauT8m.png