Raised This Month: $51 Target: $400
 12% 

tfc_setmodel with skin support


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 01-06-2012 , 16:05   tfc_setmodel with skin support
Reply With Quote #1

How can I use the skin feature as the third argument? Attached is a model which got some skins. I've tried all ways, but they just use the default model instead.

PHP Code:
tfc_setmodel(idmodel"Skin 1")
tfc_setmodel(idmodel"skin 2")
tfc_setmodel(idmodel"skin 02")
tfc_setmodel(idmodel"Skin 03")
tfc_setmodel(idmodel"Skin02")
tfc_setmodel(idmodel"skin06"
I just don't know what to put in it.
Attached Files
File Type: zip mdl.zip (204.7 KB, 87 views)
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-06-2012 , 16:14   Re: tfc_setmodel with skin support
Reply With Quote #2

I think you need to pass the integer, I mean like "1" or "01".
__________________

Last edited by Arkshine; 01-06-2012 at 16:14.
Arkshine is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-06-2012 , 17:36   Re: tfc_setmodel with skin support
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
I think you need to pass the integer, I mean like "1" or "01".
Still the same.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 01-08-2012 , 08:20   Re: tfc_setmodel with skin support
Reply With Quote #4

Are you sure it's got skins? Because in Crafty's model browser I can't see any.

Edit: Never mind, seems to be a bug in Crafty. I can see the skins in Jed's Half-Life Model Viewer.

Can't get it to work, either. Here's the code I'm using, tried various values for the skin. The model is expected to be in "models\player\panther_r\".
Attached Files
File Type: sma Get Plugin or Get Source (panther_r.sma - 593 views - 500 Bytes)

Last edited by pizzahut; 01-08-2012 at 09:36.
pizzahut is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-08-2012 , 10:00   Re: tfc_setmodel with skin support
Reply With Quote #5

Oh well. Should I report now a bug?
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 01-08-2012 , 10:23   Re: tfc_setmodel with skin support
Reply With Quote #6

Why don't you ask Watch? He's [FM]'s server OP, so he should know. Not sure if he's around though atm, Bury said:
Quote:
all a matter for when he's back online to make amendments
So not sure if it means he'll be online later today or in a few days or whatever.

Last edited by pizzahut; 01-08-2012 at 11:16.
pizzahut is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 01-10-2012 , 07:20   Re: tfc_setmodel with skin support
Reply With Quote #7

Contact info if you need it:

http://fm.myklol.net/forum/profile.p...iewprofile&u=6
http://forums.alliedmods.net/member.php?u=6997

Last edited by pizzahut; 01-10-2012 at 07:20.
pizzahut is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 01-10-2012 , 11:32   Re: tfc_setmodel with skin support
Reply With Quote #8

Thank you very much.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 01-10-2012 , 11:41   Re: tfc_setmodel with skin support
Reply With Quote #9

Quote:
Originally Posted by pizzahut View Post
Code:
Last Activity: 29-03-10 05:01
__________________
You can do anything you set your mind to, man.

Devil259 is offline
pizzahut
Senior Member
Join Date: Oct 2004
Old 03-09-2021 , 14:30   Re: tfc_setmodel with skin support
Reply With Quote #10

Sorry for the necro. Looked into this again because I wrote a plugin dealing with models and stumbled upon this old thread. I found this works, using a skin number instead of the name:

Code:
panther(player, skin)
{
  tfc_setmodel(player, "panther_r", "")

  #if AMXX_VERSION_NUM < 190
  set_pdata_int(player, (704-16)/4, skin, 4, 4)
  #else
  set_ent_data(player, "CBaseEntity", "replacement_model_skin", skin)
  #endif
}
Edit: The Linux diff seems to be 3 on newer HLDS. So should be
Code:
set_pdata_int(player, (704-16)/4, skin, 3, 3)
"set_pdata_int" works with all recent AMXX versions (1.8.2 and newer) and doesn't use the "gamedata" folders.

In folder "tfc/addons/amxmodx/data/gamedata/common.games/entities.games/tfc" the offsets in file "offsets-cbaseentity.txt" have to be checked and possibly adjusted if you want to use the "set_ent_data" function with AMXX v1.9 or v1.10.

Edit 2: I forgot, to make changes to the gamedata files, a "custom" subfolder should be used.
https://wiki.alliedmods.net/AMX_Mod_...anges#Gamedata
Attached Files
File Type: sma Get Plugin or Get Source (panther_r.sma - 50 views - 1.6 KB)

Last edited by pizzahut; 03-09-2021 at 18:51. Reason: Linux testing, updated sma.
pizzahut is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 07:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode