When I call my function, the game chokes up a bit, then nothing happens. No error in console/server, and players skin remains the same. :/
[lua]function SetTeamSkin( pl )
if pl:Team() == 1 then
pl:SetMaterial("materials/models/Actinium/Antimony")
pl:PrintMessage( HUD_PRINTTALK, "Orange")
elseif pl:Team() == 2 then
pl:SetMaterial("materials/models/Actinium/Argon")
pl:PrintMessage( HUD_PRINTTALK, "Green")
elseif pl:Team() == 3 then
pl:SetMaterial("materials/models/Actinium/Aluminum")
pl:PrintMessage( HUD_PRINTTALK, "Red")
elseif pl:Team() == 4 then
pl:SetMaterial("materials/models/Actinium/Americium")
pl:PrintMessage( HUD_PRINTTALK, "Blue")
end
end [/lua]
(oh and the PrintMessages are there just to check if the function is being called properly... which it is...)
Any Ideas?
Edit : Wrong thread
Try using materials without "materials/" ant the beginning, so it becomes pl:SetMaterial("models/Actinium/Aluminum") . This might help. Make sure that material exist on disk.
EDIT: Nvm, do what kna_rus says:
[quote=wiki]The path's root is in the materials/ folder. File extensions like .vmt or .vtf are not included. An example path is "models/shiny". [/quote]
ooops! completely forgot about that...
[editline]07:58PM[/editline]
Ok, now I get
"Material models/actinium/antimony does not support vertex format used by the mesh (maybe missing fields or mismatched vertex compression?), mesh will not be rendered. Grab a programmer!"
What does that mean? How do I fix that....
[editline]08:31PM[/editline]
Fixed
My vmt's were "LightmappedGeneric", changed them to "VertexlitGeneric"
Works fine. Thanks guys.
Ok, its working... but when the player dies, it reverts to the models default skin, Is there a way around that?
Sorry, you need to Log In to post a reply to this thread.