Jump to content
Sign in to follow this  
Phantom Six

SetObjectTexture for Player Uniform

Recommended Posts

So I'm attempting to try use some setObjectTexture to try to get custom SWAT skin for all 10 playable units. It works fine in SP, but in MP and dedicated servers, it's not working. Basically, when I join as one of the team, I don't have the custom skin nor do the AI under my command have the skins. The AI on the other team who is lead by an AI leader however have the skin. I can teamswitch to them and have the skin however, but I want it on all players.

Here's a rundown of the code that does this in the init.sqf

_swat = [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10];
[[{_x setobjecttexture [0,"Texture\swat.paa"];} forEach _swat],"BIS_fnc_Spawn",true,true] call BIS_fnc_MP;

Here is what I'm talking about on the other team have the SWAT uniform but mine.

http://i.imgur.com/STO2105.jpg?1 (490 kB)

http://i.imgur.com/QTn69KC.jpg?1 (347 kB)

http://i.imgur.com/Jr6ZnHD.jpg?1 (491 kB)

Share this post


Link to post
Share on other sites

Make sure the soldier you're applying this to is alive/existant when you run the command.

Share this post


Link to post
Share on other sites

They're alive since the start of the mission. I executed this on my init.sqf . The picture I posted on the thread is what my issue would be. The soldiers that I am and my team AIs are do not have the custom uniform skin while the AI team that I am not have it.

Share this post


Link to post
Share on other sites

Try spawning it, instead of calling. All the examples on the wiki use spawn and I remember reading it somewhere that call doesn't work.

_swat = [ p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ];
[ [ {_x setobjecttexture [ 0, "Texture\swat.paa" ]; } forEach _swat ], "BIS_fnc_Spawn", true, true ] spawn BIS_fnc_MP;

If that doesn't work, then try delaying running the code until the mission is past init (as Tajin mentions).

Share this post


Link to post
Share on other sites

hey sorry for posting if you managed to fix it could you post a mission for other to see what you did.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×