SA-MP Forums Archive
[Tutorial] SetObjectMaterial Help - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] SetObjectMaterial Help (/showthread.php?tid=331497)

Pages: 1 2


Re: SetObjectMaterial Help - Niko_boy - 12.06.2012

nice tutorial
@Psymetrix No lol
there are many of objects in game how come you know which object id has which name with TXD workshop
so better is JernejL's Map Editor in these cases


Re: SetObjectMaterial Help - Jonny5 - 12.06.2012

good tutorial!
well explained and thought me something!

thx.


Re: SetObjectMaterial Help - newbienoob - 12.06.2012

Damn.. SetObjectMaterial doesn't work with CreateDynamicObject.


Re: SetObjectMaterial Help - Jonny5 - 12.06.2012

pawn Code:
native GetDynamicObjectMaterial(objectid, materialindex, &modelid, txdname[], texturename[], &materialcolor, maxtxdname = sizeof txdname, maxtexturename = sizeof texturename);
native SetDynamicObjectMaterial(objectid, materialindex, modelid, const txdname[], const texturename[], materialcolor = 0);
native GetDynamicObjectMaterialText(objectid, materialindex, text[], &materialsize, fontface[], &fontsize, &bold, &fontcolor, &backcolor, &textalignment, maxtext = sizeof text, maxfontface = sizeof fontface);
native SetDynamicObjectMaterialText(objectid, materialindex, const text[], materialsize = OBJECT_MATERIAL_SIZE_256x128, const fontface[] = "Arial", fontsize = 24, bold = 1, fontcolor = 0xFFFFFFFF, backcolor = 0, textalignment = 0);



Re: SetObjectMaterial Help - newbienoob - 12.06.2012

Ahh, thanks!


Re: SetObjectMaterial Help - Don Lidner - 15.06.2012

I'm kinda confused, someone told me this could be used to say put letters on a wall. How would that work out?


Re: SetObjectMaterial Help - Kindred - 15.06.2012

Quote:
Originally Posted by Don Lidner
View Post
I'm kinda confused, someone told me this could be used to say put letters on a wall. How would that work out?
You cannot use this to change text on a wall, yet this can:

SetObjectMaterialText

On-Topic:

Great tutorial, I myself actually didn't know how to use this, considering I never tried it.


Re: SetObjectMaterial Help - Karkand - 18.08.2012

Sorry to bump this, however when I manage to bring up the box that appears to look like this:



The box which states 'egg_texts' (Texture) is blank upon every object I click, however the other boxes return with information. My game has NOT BEEN modified in any way. What could be the cause of this?


Re: SetObjectMaterial Help - IceMeteor - 24.08.2012

Quote:
Originally Posted by Karkand
View Post
Sorry to bump this, however when I manage to bring up the box that appears to look like this:



The box which states 'egg_texts' (Texture) is blank upon every object I click, however the other boxes return with information. My game has NOT BEEN modified in any way. What could be the cause of this?
I get this problem to, the Texture is blank, how to fix it?


Re: SetObjectMaterial Help - Augis123 - 08.09.2013

Quote:

new wang = CreateObject(11317, -1947.24695, 280.81851, 45.27340, 0.00000, 0.00000, 0.00000, 3000);
SetObjectMaterial(wang, 0, 9078, "excalibur", "ws_sandstone2", 0);

What's wrong? I playing with this code one day.. Please help...


Re: SetObjectMaterial Help - Augis123 - 10.09.2013

Up. Sorry for off-topic, but please help anyone!!


Re: SetObjectMaterial Help - iLuXing - 28.12.2014

Hello, ah...

a question?

if I need some non-breakable object, can I just create one and replace its texture??

Thank you.


Re: SetObjectMaterial Help - MonSterLikeHD - 23.04.2016

Quote:
Originally Posted by Luis-
Посмотреть сообщение
What is wrong with this?
pawn Код:
CMD:test(playerid, params[])
{
    new myobject;
    myobject = CreateObject(8397, 3629, 2112.9375, -2384.6172, 18.8828, 0.25);
    SetObjectMaterial(myobject, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);
    return 1;
}
Nice tutorial by the way
you lose the intention of the script, you need to line return 1; with the rest, like this:
Quote:

CMD:test(playerid, params[])
{
new myobject;
myobject = CreateObject(8397, 3629, 2112.9375, -2384.6172, 18.8828, 0.25);
SetObjectMaterial(myobject, 0, 19341, "egg_texts", "easter_egg01", 0xFFFFFFFF);
return 1;
}

now should work...