-
Posts
174 -
Joined
-
Last visited
Everything posted by iPanda
-
Thanks, but your example is not correct all the errors, only half of one.
-
I want to make a picture when the player aims a weapon. When the player shoots the picture remains on the screen, but when he releases the key sights, the picture disappears automatically. I have the skeleton of this function, but it is unstable - it speaks flaw. Help to complete and fix bugs. aim = guiCreateStaticImage(0.311, 0.454, 0.349, 0.626, "aim.png", true) guiSetVisible(aim, false) addEventHandler("onClientKey", root, function( button, press ) local state = ( not guiGetVisible( aim )) if ( button == "mouse2" ) then guiSetVisible( aim, state ) else guiSetVisible( aim, false ) end end)
-
With source also does not work. ps. player = getLocalPlayer()
-
Hello. I have a problem with crosshair (gunpoint). I want a player to aim weapons MP5 (ID 29), then there is a special sight. Help me. Create new crosshair (gunpoint): The event should be triggered when I press the sight (zoom_in Zoom or zoom_out), with push button "mouse2" png = guiCreateStaticImage(0.311, 0.454, 0.349, 0.626, "target.png", true) guiSetVisible(png , false) Example: addEventHandler( "onClientPlayerTarget", root, function( target ) if ( getPedWeapon( localPlayer ) == 29 ) then if ( target ) then guiSetVisible(png, true) else guiSetVisible(png, false) end end end) Also try this feature, it is shorter and I think correctly, but also does not work. function target() if isControlEnabled( zoom_in ) == true then guiSetVisible(png, true) else guiSetVisible(png, false) end end IMPORTANT: it works only when I'm aiming for vehicles. I need a sight at any time when I want to.
-
I am having problems with the combo box. I do not know how to make the function is activated. I would like to understand. EXAMPLE! Meaning: if the player selects the combobox regeneration, it receives button from the health regeneration, otherwise something else. . . Example.lua: -- Here, everything works, it's just an example. _wndw = guiCreateWindow(0.00, 0.00, 1.00, 1.00, "", true) regHP = guiCreateButton(0.93, 0.40, 0.07, 0.03, "Regeneration HP", true, _wndw) guiSetVisible( regHP , false ) -- Here is a problem: does not work. Help me. _cmbbx = guiCreateComboBox(0.01, 0.47, 0.99, 0.12, "", true, _wndw) hp = guiComboBoxAddItem(_cmbbx, "Regeneration" ) function hpFunc() if guiComboBoxGetSelected( hp ) then guiSetVisible( regHP , true) end end function bttn() setElementHealth( localPlayer, 100 ) end addEventHandler( "onClientGUIClick", regHP , bttn, false )
-
Hi guys. I have a script render the player's health. That is, as it is now in games, health regeneration happens by itself. My following code does not work. Help solve the problem. addEventHandler("onClientRender", root, function() local health = getElementHealth( player ) local renderH = 1 if health < 100 then setTimer( setElementHealth, 1000, 0, player, + renderH ) end end)
-
If you remove download="false", then I will not make the background download my files will swing at the entrance to the server. ps. Later I removed download="false". Still does not work. 1.3.4. already out.
-
I want to make the background loading models for its server. The new version of the client added two functions: downloadFile and onClientFileDownloadComplete. I have nothing. While I can not understand what the problem is and how to do this function. Help make a background download. meta.xml: "iPanda" type="script" version="1.0" /> replace.lua: addEventHandler ( "onClientFileDownloadComplete", resourceRoot, function( file, success ) if ( source == resourceRoot ) then if ( success ) then if ( file == "data/model.txd" and "data/model.dff" ) then TXD = engineLoadTXD ( "data/model.txd" ) engineImportTXD ( TXD, 476 ) DFF = engineLoadDFF ( "data/model.dff", 476 ) engineReplaceModel ( DFF, 476 ) end end end end) What I want to get: If a player does not use the car, so he does not need this machine, therefore the model of the machine it is also not necessary. Under the background downloading, I think the download of a particular model when the player uses it during the game, otherwise it does not need and does not load the player model.
-
Ren, thank you for everything! I succeeded. Here's a screenshot.
-
I almost got to make my shader. Screenshot. But I have two problems and their solutions are two options, only one is correct: 1. Perhaps the problem with exceptions black white shader. Can you please suggest any code that I can add using engineRemoveShaderFromWorldTexture that machines did not change their color. 2. Possible problem with your resource "shader_car_paint." By default, the vehicle has blue-gray color. I need a red - scarlet, which has RGB (255,36,0) Can you help me please.
-
I posted a reflection shader called golden_ped, which is a modified stock effect reflective bump from nvidia examples. It's in your last topic afaik. It's quite similar, you would need a diff cubebox tho. Sorry, but I have no idea how to change golden_ped.zip: there's too much code .fx file, I can not understand it.
-
Hi guys. I'm just starting to learn and shaders .FX files. Could you please help me in creating a shader "reflection" or "palette". To each texture was light reflection-shadow: A little light falling on texture. The example in the screenshot. p.s. I know that there are some in the community for similar shader machines, but I have a few days to do them, but nothing happens. Help create a shader with nudya relying on those that already exist.
-
I have two questions: 1. How to replace the color of the sky using shaders and his client file? (not using setSkyGradient) 2. How to replace the player skin model, if I replaced them with a new model? 1. You can't. All you can do is create a spheric object and apply effect to it's texture. You can also mess with the cloud textures, but it won't give you much. 2.You mean skin texture ? Create shader for "ped". Then apply shader to world texture. An example: http://www.solidfiles.com/d/64ae35feab/golden_ped.zip How do I create such a shader? http://www.gamer.ru/system/attached_ima ... 537243.jpg
-
I have two questions: 1. How to replace the color of the sky using shaders and his client file? (not using setSkyGradient) 2. How to replace the player skin model, if I replaced them with a new model?
-
Is there a table of the elements, which can be assigned using engineRemoveShaderFromWorldTexture?
-
You have misunderstood me. Your shader replaces only the texture areas and all. I want everything to be black and white, except for: plamyani, fire, flag, osescheniya and shadows - they ostalis unchanged (colored). Generally, the shaders in the game "The Saboteur". How to make this function?
-
Rather Camera + terribly buggy
-
Where and how do I use the engineRemoveShaderFromWorldTexture?
-
Hey, guys. My next problem - does not work function setWeaponProperty. I wanted to give the properties of the rifle "Country Rifle", but the function does not work. Help solve the problem. server.lua file local M1Garand = function() setWeaponProperty(33, "poor", "weapon_range", 180) setWeaponProperty(33, "poor", "target_range", 180) setWeaponProperty(33, "poor", "accuracy", 5) setWeaponProperty(33, "poor", "damage", 50) setWeaponProperty(33, "poor", "maximum_clip_ammo", -- s8) --> setWeaponProperty(33, "poor", "move_speed", 90) setWeaponProperty(33, "poor", "flags", 0x000010) setWeaponProperty(33, "poor", "flags", 0x008000) end addEventHandler("onResourceStart", getRootElement(), M1Garand ) ps I am using the server-side + prescribed minimum version client meta.xml
-
Please, could you write me an example of a function similar to the one that I want to do, that I understand and forever decided for themselves the problem
-
Hi guys. Need help. I have black and white shader .fx file. BUT! I want to make an exception for black and white effect. For example, the whole world is black and white, except machinery - they left their old colors. Must use engineRemoveShaderFromWorldTexture, but I do not know how to do it to me. shader.lua file (engineRemoveShaderFromWorldTexture - don`t work) local screenX, screenY = guiGetScreenSize() local screenSource = dxCreateScreenSource(screenX, screenY) local blackWhite = dxCreateShader( "data/blackwhite.fx" ) addEventHandler("onClientPreRender", getRootElement(), function() if ( blackWhite ) then dxUpdateScreenSource( screenSource ) dxSetShaderValue( blackWhite, "screenSource", screenSource ) engineRemoveShaderFromWorldTexture( blackWhite, "vehicle" ) dxDrawImage( 0, 0, screenX, screenY, blackWhite ) end end ) shader.fx file // // blackwhite.fx // texture screenSource; sampler TextureSampler = sampler_state { Texture = ; }; float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 { float4 color = tex2D(TextureSampler, TextureCoordinate); float value = (color.r + color.g + color.b) / 3; color.r = value; color.g = value; color.b = value; return color; } technique BlackAndWhite { pass Pass1 { PixelShader = compile ps_2_0 PixelShaderFunction(); } }
-
Everything works. Now I know how this feature works, thank you!
-
Your code has flaws, I corrected them, but exactly - does not work. I do not know what to do .... .... * I will use guiCreateStaticImage