subenji99
-
Posts
264 -
Joined
-
Last visited
Posts posted by subenji99
-
-
Yes, it's possible by way of shaders in MTA 1.1. Here is the shader fx code you need (provided with no restrictions by Gamesnert):
texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } }
As you can see, all it does is substitute the texture it would have used for the one you provide.
In lua, you use it like so:
addEventHandler( "onClientResourceStart", resourceRoot, function() texture = dxCreateTexture ( "path/to/imagename.png/.jpg/.bmp" ) shader, tec = dxCreateShader( "texturereplaceshader.fx" ) --bit of sanity checking if not shader then outputConsole( "Could not create shader. Please use debugscript 3" ) destroyElement( texture ) return elseif not texture then outputConsole( "loading texture failed" ) destroyElement ( shader ) tec = nil return else engineApplyShaderToWorldTexture ( shader, "internalfilenamewithoutextension" ) dxSetShaderValue ( shader, "gTexture", texture ) end end )
dxCreateTexture is quite versatile for what filetypes it will take, but it will not accept txd files, and the files given should be in sizes of a power of 2. (1,2,4,8,16,32,64,128,256...) If you don't want a texture to be stretched/cropped, it should match the size of the texture you're replacing.
You can call the shader file whatever you want, as long as it's referenced correctly in the code and the meta.xml. Use the tag.
The internal texture file name can be retrieved in one of 2 ways: the 'hard' way of calling https://wiki.multitheftauto.com/wiki/Eng ... xtureNames and trying to identify which one in the list you are after,
or how DazzaJay hinted at above, open the relevant TXD file in an editor and see what the filename is for the texture you want to replace. Don't append an extension.
The dxSetShaderValue line actually passes the texture data to the shader. If you want an animated texture, you can keep calling this function. (this is what Gamesnert's nyancat resource does) the "gTexture" string is a reference to the texture variable defined in the shader file.
Remember to also send your clients the image file! Again, use the tag.
common names for car paintjobs:
body256
e.g.:
elegy2body256
flash3body256
jester1body256
stratum2body256
sultan2body256
-
http://gamingbolt.com/2010/03/20/15-mod ... pc-gaming/
GamingBolt ran an article on ther 15 most influential PC modding teams and MTA Team came 13th!
“PC mods, or modifications, are one of the primary reasons why the PC is often looked on as superior to its console brothers. Mods can be anything from new game modes, to new units, to graphical enhancements to complete game overhauls. However, behind the mods are a team of focused, dedicated people, who rarely get the accolades they deserve.”Grand Theft Auto San Andreas takes the award for having the largest living GTA universe. Some argue that it was the best game in the franchise- and the massive amounts of free roaming and the (slight) emphasis on realism really helped push the game above and beyond people’s expectations. One thing the game didn’t have though, was multiplayer. This was sorely missed in a game with so much racing and free roaming potential, but luckily the good folks behind MTA found a solution. What started out as an experiment with crude forms of online racing has turned into the one truly decent, fully functioning multiplayer segment to a great game.I've always felt MTA hasn't received half of the attention it rightly deserves in relation to the effort that has gone into it. The entire team should be very proud of their accomplishments, and congratulations on the accolade!
-
http://www.rpmfind.net//linux/RPM/fedor ... .i586.html
When dealing with dependencies, it's always best to search for a package that provides it.
-
The non-functional "community" login is not how you authenticate with your own server.
Read the server manual again.
-
Funny, I thought the archive link was there for just that reason.
And indeed, http://files.mtasa.com/apps/1.0/race/
-
local SpawnElements = getElementsByType ( "spawnpoint", mapRoot ) for key, value in pairs(SpawnElements) do --DELETE THIS LINE!!! local value = SpawnElements[math.random(#SpawnElements)] local x = tonumber( getElementData( value, "posX" ) ) --50p was correct in that these have to be converted to numbers, I missed that local y = tonumber( getElementData( value, "posY" ) ) local z = tonumber( getElementData( value, "posZ" ) ) local r = tonumber( getElementData( value, "rotZ" ) or 0 ) repeat until spawnPlayer ( thePlayer , x, y, z, r, math.random (0,288)) end --DELETE THIS LINE!!!
Do you have any notion of code execution AT ALL?
Look back to what I said earlier:
Edit: Quick glance at your code reveals that IF it's getting the data from the map file correctly (I didn't look at that) your loop will overwrite x,y,z,r each time, then the values they will actually contain every single time it reaches spawnPlayer will be the ones for your final spawnpoint in the map file.I told you what to put in instead of looping through, and you totally ignored me and just pasted in my replacement, IN THE LOOP I TOLD YOU NOT TO USE.
You are currently spawning the same player over and over again for as many times as you have spawnpoints.
Remove the for...do ... end loop lines altogether. You do NOT need to parse every spawnpoint, just pick one of them, which the code I wrote for you did.
This will be the last time I help you in this matter, as clearly you just want someone to just fix your code for you. I help people correct their mistakes, not do their work for them.
-
Or you failed to notice that the result was a Heuristics detection, meaning your anti-virus "guessed" as it does modify an executable, which is often (but not always) virus behaviour.
-
-
If I recall, Interstate69 had fatal issues (causing a server crash I think), which is why it was not updated.
As long as you give credit however, I doubt anyone would mind it being fixed up, and it may well be possible that the problem does not exist anymore.
-
If I recall, Interstate69 had fatal issues (causing a server crash I think), which is why it was not updated.
As long as you give credit however, I doubt anyone would mind it being fixed up, and it may well be possible that the problem does not exist anymore.
-
Quick note - this code will kick anyone that plays with a gamepad and uses an analog stick for input.
-
Quick note - this code will kick anyone that plays with a gamepad and uses an analog stick for input.
-
https://wiki.multitheftauto.com/wiki/Character_Skins
List of valid skin IDs.
And in case you are even lazier than clicking a link:
Non-working IDs1-6 8 42 65 74 86 119 149 208 265-273
The best option around this is to use
repeat until spawnPlayer ( thePlayer , x, y, z, r, math.random (0,288)) end
Edit: Quick glance at your code reveals that IF it's getting the data from the map file correctly (I didn't look at that) your loop will overwrite x,y,z,r each time, then the values they will actually contain every single time it reaches spawnPlayer will be the ones for your final spawnpoint in the map file. Use:
local value = SpawnElements[math.random(#SpawnElements)] local x = getElementData( value, "posX" ) local y = getElementData( value, "posY" ) local z = getElementData( value, "posZ" ) local r = getElementData( value, "rotZ" ) or 0 repeat until spawnPlayer ( thePlayer , x, y, z, r, math.random (0,288)) end
This will pick a random spawnpoint element rather than loop through all of them.
Edit2: getElementData( value, "rot" ) is returning nil. It doesn't exist, as your map file contains "rotX, rotY, rotZ" values.
Edit3: Your timers are not passing "thePlayer" to your joinHandler function.
Alter them:
setTimer( joinHandler, 1800, 1, source )
Edit4: This just won't work. (Line 7)
triggerEvent ( "PlayerSpawn", rootElement )
Again, it will not receive "thePlayer". You should use getElementsByType("player") and loop through them, triggering your event for each and making sure to pass on the player element.
-
https://wiki.multitheftauto.com/wiki/Character_Skins
List of valid skin IDs.
And in case you are even lazier than clicking a link:
Non-working IDs1-6 8 42 65 74 86 119 149 208 265-273
The best option around this is to use
repeat until spawnPlayer ( thePlayer , x, y, z, r, math.random (0,288)) end
Edit: Quick glance at your code reveals that IF it's getting the data from the map file correctly (I didn't look at that) your loop will overwrite x,y,z,r each time, then the values they will actually contain every single time it reaches spawnPlayer will be the ones for your final spawnpoint in the map file. Use:
local value = SpawnElements[math.random(#SpawnElements)] local x = getElementData( value, "posX" ) local y = getElementData( value, "posY" ) local z = getElementData( value, "posZ" ) local r = getElementData( value, "rotZ" ) or 0 repeat until spawnPlayer ( thePlayer , x, y, z, r, math.random (0,288)) end
This will pick a random spawnpoint element rather than loop through all of them.
Edit2: getElementData( value, "rot" ) is returning nil. It doesn't exist, as your map file contains "rotX, rotY, rotZ" values.
Edit3: Your timers are not passing "thePlayer" to your joinHandler function.
Alter them:
setTimer( joinHandler, 1800, 1, source )
Edit4: This just won't work. (Line 7)
triggerEvent ( "PlayerSpawn", rootElement )
Again, it will not receive "thePlayer". You should use getElementsByType("player") and loop through them, triggering your event for each and making sure to pass on the player element.
-
Stop feeding the troll.
-
Stop feeding the troll.
-
https://wiki.multitheftauto.com/wiki/Res ... _to_see_it
The wiki exists for a reason...
-
https://wiki.multitheftauto.com/wiki/Res ... _to_see_it
The wiki exists for a reason...
-
Recent nVidia drivers also support a "stereoscopic" addon that allows you to apply and customize this effect on any DirectX game, for Windows Vista and Windows 7.
-
Recent nVidia drivers also support a "stereoscopic" addon that allows you to apply and customize this effect on any DirectX game, for Windows Vista and Windows 7.
-
As I stated above, the problem looks to be that those events currently only seem to work correctly on real players, not scripted peds.
-
As I stated above, the problem looks to be that those events currently only seem to work correctly on real players, not scripted peds.
-
Ahem!
killPed - Server-only functionNot to mention the debug error is stating "killPed" is nil, not "source".
-
Ahem!
killPed - Server-only functionNot to mention the debug error is stating "killPed" is nil, not "source".
[HELP]Replace car paintjobs?
in Scripting
Posted
Indeed, the shader can be applied/unapplied at will to control whether the texture is replaced or not, and shaders can do a whole lot more than just basic texture replacement!