SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 11/03/2015, 06:07 AM   #1
CuervO
High-roller
 
CuervO's Avatar
 
Join Date: Oct 2008
Posts: 1,164
Reputation: 200
Default SetObjectMaterial + Weapon Objects

Hello there,

As I was working on the inventory script I wondered what would happen if I colored a weapon. Turns out that the weapon becomes invisible if you recolor it using SetObjectMaterial no matter what index or color you input:


I took an object, recolored it to red using parameters
Code:
0, -1, "none", "none", FFFF0000 
1, -1, "none", "none", FFFF0000
Result: http://i.imgur.com/lqzCT0Z.jpg

Using my script I swapped the object which retains the material information
Swap: http://i.imgur.com/SXb8h4p.jpg
Object ID: 355 (AK47 model)

Object became invisible
Result: http://i.imgur.com/f2Q4NmX.jpg

Then swapped the object back to something else to test the material
Result: http://i.imgur.com/tWWs6AP.jpg


So the materials were correctly set, but the object became invisible as soon as SetObjectMaterial was applied; oddly enough, recoloring them when on your hand does work:
Result: http://i.imgur.com/N3e4007.jpg
(This is the actual color that is stored in the db for the object, which is -10092289 (FF6600FF), and yes, I have an RGBA to ARGB)


So, how do you recolor a weapon object dropped on the ground, what parameters do you need exactly?
__________________
[IMG]http://************/pdpu4qe[/IMG]    - Team Fortress 2 [Gamemode] [SQL] [Whirlpool] [Streamer] [Sscanf] [ZCMD]
[IMG]http://************/pdpu4qe[/IMG] - Live map object editor [Filterscript] [DINI] [Streamer] [Sscanf] [ZCMD]
[img]http://************/pdpu4qe[/img] [img]http://************/nfxrrrz[/img] - Inventory & Object System [Filterscript] [SQL] [Streamer] [Sscanf] [ZCMD]

- RenderMessage(toAll) [Snippet]
CuervO is offline   Reply With Quote
Old 15/03/2015, 10:27 AM   #2
CuervO
High-roller
 
CuervO's Avatar
 
Join Date: Oct 2008
Posts: 1,164
Reputation: 200
Default Respuesta: SetObjectMaterial + Weapon Objects

Does anyone have a method or a solution to this problem? Am I doing something wrong? Should this be posted on bug reports?
__________________
[IMG]http://************/pdpu4qe[/IMG]    - Team Fortress 2 [Gamemode] [SQL] [Whirlpool] [Streamer] [Sscanf] [ZCMD]
[IMG]http://************/pdpu4qe[/IMG] - Live map object editor [Filterscript] [DINI] [Streamer] [Sscanf] [ZCMD]
[img]http://************/pdpu4qe[/img] [img]http://************/nfxrrrz[/img] - Inventory & Object System [Filterscript] [SQL] [Streamer] [Sscanf] [ZCMD]

- RenderMessage(toAll) [Snippet]
CuervO is offline   Reply With Quote
Old 15/03/2015, 11:53 AM   #3
Pottus
High-roller
 
Pottus's Avatar
 
Join Date: Jun 2012
Posts: 4,899
Reputation: 1321
Default Re: SetObjectMaterial + Weapon Objects

Some objects have this effect unfortunately your not doing anything wrong but there is nothing you can do about it.
Pottus is offline   Reply With Quote
Old 15/05/2019, 06:16 AM   #4
Jasno
Little Clucker
 
Join Date: Nov 2017
Posts: 31
Reputation: 0
Default Re: SetObjectMaterial + Weapon Objects



I just used the texture studio.
without it fails


I still have not solved this problem, who knows how to change the color? After all, the texture studio was a success!
Jasno 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
Removing objects and replacing them for SetObjectMaterial Hoborific Scripting Help 5 26/05/2013 05:20 AM
Objects are reflecting after SetObjectMaterial leong124 Scripting Help 2 21/01/2013 11:59 AM
SetObjectMaterial objects does not appear okil Scripting Help 2 19/12/2012 08:26 PM
Objects behaving weird with setobjectmaterial + a large object Lorenc_ Scripting Help 7 08/05/2012 07:30 AM
SetObjectMaterial with objects with the same modelid Baboon Scripting Help 5 08/04/2012 03:54 PM


All times are GMT. The time now is 12:47 PM.


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