SA-MP Forums Archive
attach object with new texture - 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: attach object with new texture (/showthread.php?tid=490899)



attach object with new texture - cnoopers - 28.01.2014

look. when i attach that object to player, i have warning in game and i got old texture on this.
but when i dont attach this to player, object got new texture. whats wrong?
Code:
new object;
object = SetPlayerAttachedObject(playerid,0,19445,6,0.000000,-0.013999,-0.008999,0.000000,-0.999999,1.799999,1.002999,1.380000,1.190999);
SetObjectMaterialText(object, "||", 0, 140, "Arial", 200, 0, -16777216, -11726, 1);
Code:
Warning(opcode 0x108): Exception 0xC0000005 at 0x59F7A8



Re: attach object with new texture - cnoopers - 28.01.2014

bump, whos can help me?


Re: attach object with new texture - Syncro - 28.01.2014

You must use the function "SetPlayerObjectMaterialText"
https://sampwiki.blast.hk/wiki/SetPlayerObjectMaterialText

Good Luck


Re: attach object with new texture - cnoopers - 28.01.2014

yes, but i need show new texture for all players, not only for me.


Re: attach object with new texture - Syncro - 28.01.2014

Use foreach (include extra) or use the loop for().
Example:
Code:
for(new i; i < MAX_PLAYERS; i++)
{
      // Functions for every player
}



Re: attach object with new texture - pyrodojo25 - 28.01.2014

SetPlayerAttachedObject doesn't return any objectid so you can't apply SetObjectMaterialText or SetPlayerObjectMaterialText to it. And unfortunately there isn't any other function which will set material text to SetPlayerAttachedObject


Re: attach object with new texture - cnoopers - 28.01.2014

Not Work!
Code:
	new object;
    object = SetPlayerAttachedObject(playerid,0,19445,6,0.000000,-0.013999,-0.008999,0.000000,-0.999999,1.799999,1.002999,1.380000,1.190999);

	for(new i; i < MAX_PLAYERS; i++)
	{
	      SetPlayerObjectMaterialText(playerid, object, "||", 0, 140, "Arial", 200, 0, -16777216, -11726, 1);
	}
@up
So, how can i change it on vehicle? I know, its possible.


Re: attach object with new texture - Vince - 28.01.2014

SetPlayerAttachedObject uses a different object pool. Objects that are attached to vehicles belong to the "normal" pool.