[CSGO] Setting Hand Viewmodel
Posted: Sun May 02, 2021 9:47 pm
I made myself a command in my plugin to allow players to set their player models to custom models that are downloaded, and I wanted to be able to set the ViewModel to the ones included. However, I'm not sure how to do this.
The way I was trying wasn't visibly changing anything. Could it be I have to hide the ViewModel first? if not I'd like help trying to get the hand model to work, as well as hiding the previous hand model so there's no overlap (if it applies).
Thanks,
- Grubbsy.
Syntax: Select all
# Model Link: https://gamebanana.com/skins/171233
# Model Path: "models/player/custom_player/eminem/player_start/player_start.mdl"
# Model Hand Path: "models\player\custom_player\eminem\player_start\player_start_arms.mdl"
@TypedSayCommand('/model')
def model_test_cmd(cmd):
player = _players[cmd.index] # This is how I keep track of players
player.model = Model("models/player/custom_player/eminem/player_start/player_start.mdl") # This sets the player's model
# This is meant to set the hand model in the first-person mode.
# This is the way I tried and it doesn't change the model, but nothing changes. I am precaching the model.
# This is also the best I've gotten because it didn't throw errors at me or cause some really weird stuff to happen
player.draw_view_model = engine_server.precache_model("models\player\custom_player\eminem\player_start\player_start_arms.mdl")
The way I was trying wasn't visibly changing anything. Could it be I have to hide the ViewModel first? if not I'd like help trying to get the hand model to work, as well as hiding the previous hand model so there's no overlap (if it applies).
Thanks,
- Grubbsy.