SA-MP Forums Archive
SetObjectMaterial Issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: SetObjectMaterial Issue (/showthread.php?tid=612016)



SetObjectMaterial Issue - SsHady - 13.07.2016

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,


Re: SetObjectMaterial Issue - Dejan12345 - 13.07.2016

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 ////////////////////////////////////////////


Re: SetObjectMaterial Issue - SsHady - 13.07.2016

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.


Re: SetObjectMaterial Issue - Dejan12345 - 13.07.2016

i say you


Re: SetObjectMaterial Issue - DRIFT_HUNTER - 13.07.2016

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.


Re: SetObjectMaterial Issue - Vince - 13.07.2016

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


Re: SetObjectMaterial Issue - Luicy. - 13.07.2016

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?