SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 14/11/2019, 08:37 PM   #1
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 19
Default question SetObjectMaterialText

Hello I use SetObjectMaterialText to use webdings character because they are looking cool, but my question is how can use the samp sprites https://imgur.com/6A6Eavy on the objects? I know on textdraw the font is number 4 but what is the name of the font to use it on setobjectmaterialtext?
Mister0 is offline   Reply With Quote
Old 15/11/2019, 07:47 AM   #2
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,119
Reputation: 68
Default Re: question SetObjectMaterialText

you have to use SetObjectMaterial, instead of SetObjectMaterialText, you can change textures with that.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 15/11/2019, 02:04 PM   #3
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 19
Default Re: question SetObjectMaterialText

Quote:
Originally Posted by Mugala View Post
you have to use SetObjectMaterial, instead of SetObjectMaterialText, you can change textures with that.
if I use this it doesn't show anything

Code:
	SetDynamicObjectMaterial(obj, 0, 0,"ld_grav:bee1", "ld_grav.txd", 0xFFFFFFFF);
I try to change name extensions and nothing work to display that bee https://imgur.com/6A6Eavy or another sprite
Mister0 is offline   Reply With Quote
Old 15/11/2019, 02:21 PM   #4
Mugala
High-roller
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 1,119
Reputation: 68
Default Re: question SetObjectMaterialText

no, you don't have to use it like a sprite (I mean ld_grav:bee1), just take a texture name from ld_grav.txd, in that case bee1.
__________________
Coding in 8 languages including Pawn, C#, C++ and SQL.
Available for hiring.

If you have a coding question or need an assistance in a code, just PM me.
If you want me to create something for you, here is a Discord Mugala#5651

Currently helping Community members in a coding.
Mugala is offline   Reply With Quote
Old 15/11/2019, 02:26 PM   #5
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 19
Default Re: question SetObjectMaterialText

same thing, nothing to display
SetDynamicObjectMaterial(obj, 0, 0,"bee1", "ld_grav.txd", 0xFFFFFFFF);
Mister0 is offline   Reply With Quote
Old 15/11/2019, 06:11 PM   #6
RoboN1X
Huge Clucker
 
RoboN1X's Avatar
 
Join Date: Feb 2011
Location: Indonesia
Posts: 391
Reputation: 92
Default Re: question SetObjectMaterialText

You cant use textdraw sprites as object material
only in 0.3.8/DL you can use texture from custom models or sprites* as object material
* note that 0.3.8 allows a custom model textures to be loaded as textdraw sprites, you can already use anything in that has model id registered (e.g. createable objects) texture files as object material without having custom 0.3.8 models
The reason behind this because setobjectmaterial requires source model id (which i said creatable) to locate and load the texture files. You put 0 doesnt mean it will load any texture, instead it will load alpha texture.
also you dont need to write .txd in the parameter.
__________________
Need Help? Use Search, WIKI, and FAQ
RoboN1X is offline   Reply With Quote
Old 15/11/2019, 06:30 PM   #7
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 19
Default Re: question SetObjectMaterialText

Quote:
Originally Posted by RoboN1X View Post
You cant use textdraw sprites as object material
only in 0.3.8/DL you can use texture from custom models or sprites* as object material
* note that 0.3.8 allows a custom model textures to be loaded as textdraw sprites, you can already use anything in that has model id registered (e.g. createable objects) texture files as object material without having custom 0.3.8 models
The reason behind this because setobjectmaterial requires source model id (which i said creatable) to locate and load the texture files. You put 0 doesnt mean it will load any texture, instead it will load alpha texture.
also you dont need to write .txd in the parameter.
It is posible, just look at 2:03 https://youtu.be/9ThrB0oV8oU?t=123
But I don't know what font name or texture material name is
Mister0 is offline   Reply With Quote
Old 15/11/2019, 06:43 PM   #8
RoboN1X
Huge Clucker
 
RoboN1X's Avatar
 
Join Date: Feb 2011
Location: Indonesia
Posts: 391
Reputation: 92
Default Re: question SetObjectMaterialText

Quote:
Originally Posted by Mister0 View Post
It is posible, just look at 2:03 https://youtu.be/9ThrB0oV8oU?t=123
But I don't know what font name or texture material name is
theres no font name for that dude... you confuse textdraw font with system font... textdraw uses game font, objectmaterialtext uses system font (arial, comic sans, impact, tahoma, etc)

You can copy the texture add into custom model in 0.3.8 or custom img file and you will be able to use the sprites

All that server use is to trick the client to load the bee texture as textdraw first, it will not work if the textdraw was not rendered (it will be blank for other players unless they do the same). Just like with what i done with skin models for cop tied body snippet i made years ago, which is why copying it as 0.3.8 model texture is the best since everyone can see it.

If you dont believe then go ask that server in the video
__________________
Need Help? Use Search, WIKI, and FAQ
RoboN1X is offline   Reply With Quote
Old 15/11/2019, 06:49 PM   #9
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 19
Default Re: question SetObjectMaterialText

I still didn't find a solution for me, How can I put that bee on objects?
Mister0 is offline   Reply With Quote
Old 15/11/2019, 07:06 PM   #10
RoboN1X
Huge Clucker
 
RoboN1X's Avatar
 
Join Date: Feb 2011
Location: Indonesia
Posts: 391
Reputation: 92
Default Re: question SetObjectMaterialText

Quote:
Originally Posted by Mister0 View Post
I still didn't find a solution for me, How can I put that bee on objects?

I think i already gave you a clue..

0.3.DL approach, copy the txd file in custom model folder, add it for download (assign the id), use object material with the texture & the custom model id.

Nothing to do with SetObjectMaterialText
__________________
Need Help? Use Search, WIKI, and FAQ
RoboN1X is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SetObjectMaterialText Question okil Scripting Help 0 02/12/2012 12:19 PM
SetObjectMaterialText Question okil Server Support 0 02/12/2012 11:54 AM
[Question] SetObjectMaterialText tony_fitto Scripting Help 0 26/07/2012 04:04 PM
Question about SetObjectMaterialText Dodo9655 Scripting Help 1 03/07/2012 07:41 PM


All times are GMT. The time now is 03:31 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.