SetObjectMaterial Issue
#1

Hey,

So basically my first question is that what is the difference between SetObjectMaterial and SetPlayerObjectMaterial?

Secondly, I'm having a problem. I tried changing an objects texture but it won't fucking change..
On top I Have
pawn Код:
new myobject;
Then I have my object creation code under OnGameModeInIt
pawn Код:
myobject = CreateObject(18783, 496.43228, 2003.58862, 54.59914,   0.00000, 0.00000, 0.00000);
Then I firstly put my SetObjectMaterial code under OnGameModeInIt, to check if it works there. but it didnt.
pawn Код:
SetObjectMaterial(myobject, 0, 14662, "711c", "bwtilebroth", 0);
        SetObjectMaterial(myobject, 1, 14662, "711c", "bwtilebroth", 0);
        SetObjectMaterial(myobject, 2, 14662, "711c", "bwtilebroth", 0);
Then I thought about making a command to change textures. but it didnt work either.
pawn Код:
if (strcmp("/magic", cmdtext, true, 10) == 0)
    {
        SetObjectMaterial(myobject, 0, 14662, "711_c", "bwtilebroth", 0);
        SetObjectMaterial(myobject, 1, 14662, "711_c", "bwtilebroth", 0);
        SetObjectMaterial(myobject, 2, 14662, "711_c", "bwtilebroth", 0);
        return 1;
    }
I really don't know what's the issue, I would also like to know where to put the SetObjectMaterial? What would be its best place to use without putting it in any command. So the textures automatically change without having anyone type anything.

Thanks,
Reply
#2

Find you Public On gamemode init and say what you want ////////////////////////////your name to call//////////////////////////////
copy your set object and paste there and close with ////////////////////////////////////////////
Reply
#3

Quote:
Originally Posted by Dejan12345
Посмотреть сообщение
Find you Public On gamemode init and say what you want ////////////////////////////your name to call//////////////////////////////
copy your set object and paste there and close with ////////////////////////////////////////////
Pass me the stuff you're smoking.
Reply
#4

i say you
Reply
#5

SetObjectMaterial is used for objects created with CreateObject function
SetPlayerObjectMaterial is used for objects created with CreatePlayerObject function

Difference between CreateObject and CreatePlayerObject is that CreateObject will create object for everyone, while CreatePlayerObject will create object seen only by given player.


About material text not changing. Usually when i have such problem i just copy/paste new.pwn into gamemodes and test it in clean GM. So should you. I dont see reason why it would not work if you did as you say.

The only thing i noticed is "711c" and "711c_c" for texture name. Texture name must be exact name of TXD file used.
Reply
#6

I can't find a texture library named "711c.txd" in gta3.img. So that's certainly incorrect.
Reply
#7

Quote:
Originally Posted by Dejan12345
Посмотреть сообщение
Find you Public On gamemode init and say what you want ////////////////////////////your name to call//////////////////////////////
copy your set object and paste there and close with ////////////////////////////////////////////
Whatchu high on? Weed? Meth? Cocaine? Heroin?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)