PDA

View Full Version : Custom weapon / player models, how to change them!


Tank
04-28-2010, 03:11 AM
Recently I saw a few posts up on how to change the player models and the weapon models on a server. Since there were a few, I believe by MosDod and {RSR}Crazyhorse_cdn I was too lazy to look them up and post it in there, however since I was curious if we ever created something for it or that we kept referring to something which doesn't excist I did a small search on it and this is what I came up with.

For custom player models:

Zor's Admin Models
http://www.dodplugins.net/forums/showthread.php?t=5

A thread about a simpler Admin Models
This is perhaps easier to create something to fit your needs
http://www.dodplugins.net/forums/showthread.php?t=1020&highlight=models

For custom weapon models:

I did not test this, but looks promising
http://forums.alliedmods.net/showthread.php?p=374055

Somebody please test the above posted model to change custom weapon models. If that doesn't work perhaps one of the developers can use the following pieces of code taken from dod_ninja (found here: http://www.dodplugins.net/forums/showthread.php?t=51&highlight=models). From what I see this is the stuff needed:


//================================================== =======
// Plugin Initialization
//================================================== =======
public plugin_init()
{
register_plugin("Tank's ????",VERSION,"The Tank")
register_cvar("tanks_?????",SVERSION,FCVAR_SERVER|FCVAR_SPONLY)

register_event("CurWeapon", "check_weapon","be")

p_enable = register_cvar("model_changer","1")
}

public plugin_precache()
{
precache_model("models/Katana.mdl")
precache_model("models/p_katana.mdl")
return PLUGIN_CONTINUE
}

public check_weapon(id)
{
new clip, ammo, wpnid = dod_get_user_weapon(id,clip,ammo)
if (wpnid == DODW_SPADE || wpnid == DODW_AMERKNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/Katana.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_katana.mdl")
}
}


Before people start, the above posted wont work. However may give developers a slight heads up if anyone feel like creating something basic if the above posted plugin to change custom weapon models don't work.

Dr.G
04-30-2010, 03:19 PM
That was fast made Tank, too fast =)

->

#include <amxmodx>
#include <dodx>
#include <engine>

new const PLUGIN[] = "Tank's Model thingy"
new const VERSION[] = "v1.0"
new const AUTHOR[] = "Tank"

new p_enable

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("tanks_mdl_thing", VERSION, FCVAR_SERVER|FCVAR_SPONLY)

register_event("CurWeapon", "check_weapon","be")

p_enable = register_cvar("model_changer","1")
}

public plugin_precache()
{
precache_model("models/Katana.mdl")
precache_model("models/p_katana.mdl")
return PLUGIN_CONTINUE
}

public check_weapon(id)
{
if(!get_pcvar_num(p_enable))
return PLUGIN_CONTINUE

new wpnid = dod_get_user_weapon(id)

if (wpnid == DODW_SPADE || wpnid == DODW_AMERKNIFE)
{
entity_set_string(id, EV_SZ_viewmodel, "models/Katana.mdl")
entity_set_string(id, EV_SZ_weaponmodel, "models/p_katana.mdl")
}
return PLUGIN_CONTINUE
}

Tank
04-30-2010, 04:29 PM
Before people start, the above posted wont work.

It's just a few pieces of code, it's not developed to work