Changing weapon models (Extended)
Note if this example is in your plugin: If its 80%> of your whole script, I suggest you dont post it as a plugin.
This is a small example on changing weapon models for Counter-Strike. With this example you can change all 3 types of the model: view, player, and world. I have written one with Engine and Fakemeta for people who are not familiar with Fakemeta yet, and one only on fakemeta for L33T coders. I hope this helps, so people dont need to keep posting about this ;). Engine and Fakemeta Code:
#include <amxmodx> Code:
public Event_CurWeapon(id) Weapon ID reference Code:
#define CSW_P228 1 Example of changing the skin of the knife Code:
#include <amxmodx> |
Re: Changing weapon models
Cool. One question though, does this work for both player models and weapon models?
|
Re: Changing weapon models
I'd like to know why you include both engine and fakemeta. You should probably use one or the other. If I were you, I'd use fakemeta though.
|
Re: Changing weapon models
Works with v_, p_, and w_ models.
@Hawk552 I used fakemeta for FM_SetModel, and engine to simplify the example. I suck with fakemeta. |
Re: Changing weapon models
Quote:
|
Re: Changing weapon models
Show an example using only engine and then using only fakemeta. :up:
|
Re: Changing weapon models
@ Hawk552
Done. @ Brad Dont know if engine has a forward like FM_SetModel. You can probably try hooking it in server_frame or pfn_spawn. @ RapHero2000 Model isn't found. Most probably you have v_<model name>.mdl You must use the actual model name eg. "v_custom_m4a1.mdl". |
Re: Changing weapon models
I tried making this so that it only showed the model when a player has 'purchased' the model through a menu, but when I try to give the player a weapon at the begining of the round (resethud) it crashes the server... If I give the gun to the player as soon as he/she buys it, and doesn't die, then the next round the model loads, but not immediatly... It does show the model when I drop the weapon to the ground... I'm so confused...
-Edit: Fixed it. |
Re: Changing weapon models
For Fakemeta you don't need to allocate the string when using viewmodel2 or weaponmodel2.
Amended above example: Code:
// this set's the view model (what you see when holding the gun) |
Re: Changing weapon models
This will be noted. Thanks
|
All times are GMT -4. The time now is 09:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.