SetObjectMaterial Question and Discussion

Hey Everyone,

I was reading some topics on the forums and i got to know about the new addition to SA-MP 0.3e
Which is : SetObjectMaterial and SetPlayerObjectMaterial. So i checked the official wiki thread of this new function.

So the parameters information was as follows:

pawn Код:
(objectid, materialindex, modelid, txdname[], texturename[], materialcolor)
objectid    The ID of the object to change the texture of
materialindex   The material index on the object to change
modelid The modelid on which the replacement texture is located (use 0 for alpha)
txdname The name of the txd file which contains the replacement texture (use "none" for alpha)
texturename The name of the texture to use as the replacement (use "none" for alpha)
materialcolor   The object color to set, as an integer or hex in ABGR color format. Using 0 keeps the existing material color.

Returns This function doesn't return a specific value

So the problem is what happens when i use this function with One Model Id to Second Model Id? It changes the texture of the both the objects or from one to second.

But what exactly does it change? What does the term "Texture" means over here? Can someone please elaborate this to me properly?

The main problem is to understand the usage of this new function added to SAMP 0.3e

Ballu Miaa

Dude post this here,
SA-MP 0.3e RC scripting

it changes the the texture of an object (objectid), to any texture you want from another object

example (not by me)

Originally Posted by HuSs3n
Посмотреть сообщение
it changes the the texture of an object (objectid), to any texture you want from another object

example (not by me)
This is changing the color of the model id? So this is what it does? Isnt it mate? Fucking awesome if this is so.

Originally Posted by Faisal_khan
Посмотреть сообщение
Dude post this here,
SA-MP 0.3e RC scripting
Will post out there next time ima ask something about SA-MP 0.3e. Ma bad mate!

SetObjectMaterial has the following variables:

1. ObjectID = The object you want to change the textures of.
2. MaterialIndex = Most objects have more than 1 texture. It's likely that you just want to change 1 particular texture. If you take a piece of road, for example, you'll see in Jernel's Map Editor that it has a texture for the road and a texture for the pavement next to the road.
Material 0: pave256
Material 1: road128
If you want to change the texture of the road, in this case you'd use material index 1.
3. ModelID = The object that contains the texture you want to use for ObjectID.
4. Texture = Doubleclick the ModelID in Jernel's Map Editor, and you'll see 1 name next to "Texture:", enter that name in this variable.
5. TXD Textures = Just like the original object, the object that has the texture you want to use usually also has more than 1 texture. To make sure you get the right texture from the object, type the proper texture you want to use from the list in Jernel's Map Editor.
6. If you want to change the color of the texture you're using to replace another texture, enter the color code here in the ABGR format. If you don't want to change the color, just enter 0.

Hope this helps, took me some time to figure out as well

Uhhh that helps alot.i.e we can merge different objects textures with some other objects as well as we can change the colors. Seems awesome to me. Thanks alot for helping me with this everyone!

Rep added to all the poster's. (Enjoy three rep points yo xD)

- BMiaa

Forum Jump:

Users browsing this thread: 1 Guest(s)