AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   REPLACE MODEL HELP (https://forums.alliedmods.net/showthread.php?t=21058)

angel killer 11-23-2005 00:55

REPLACE MODEL HELP
 
ok so i was working on this plugin to replace weapons in my server and i got the models to precache but in game were the modle should be there is nothing here is the code

Quote:

Weapon Constants:

CSW_P228
CSW_SCOUT
CSW_HEGRENADE
CSW_XM1014
CSW_C4
CSW_MAC10
CSW_AUG
CSW_SMOKEGRENADE
CSW_ELITE
CSW_FIVESEVEN
CSW_UMP45
CSW_SG550
CSW_GALI
CSW_GALIL
CSW_FAMAS
CSW_USP
CSW_GLOCK18
CSW_AWP
CSW_MP5NAVY
CSW_M249
CSW_M3
CSW_M4A1
CSW_TMP
CSW_G3SG1
CSW_FLASHBANG
CSW_DEAGLE
CSW_SG552
CSW_AK47
CSW_KNIFE
CSW_P90
*/

#include <amxmodx>
#include <amxmisc>
#include <engine>

public plugin_init()
{
register_plugin("Gun Replacement","1.0","Lord Saddler/Angel killer");
register_event("CurWeapon","handle_gun","be", "1=1");
}

public handle_gun(id)
{
if(!is_user_alive(id))
{
return 0
}

new clip, ammo
new weap = get_user_weapon(id,clip,ammo)
if(weap == CSW_DEAGLE)//<--- Replace with a different weapon constant to replace another weapon
{
entity_set_model (id, EV_SZ_viewmodel, "models/p_shield_deagle_2.mdl")//<--- Change the model name for different weapons :)
entity_set_model (id, EV_SZ_weaponmodel, "models/v_shield_deagle_2.mdl")//<--- Change the model name for different weapons :)
}

return 0
}


public plugin_precache()
{
precache_model("models/p_shield_deagle_2.mdl");
precache_model("models/v_shield_deagle_2.mdl");
}

uTg | bigpapajiggs 11-23-2005 01:01

Add #include <cstrike> under #include <engine>

lol :oops:

XxAvalanchexX 11-23-2005 01:15

You have viewmodel and weaponmodel reversed.

angel killer 11-23-2005 01:21

what do you meen ?

angel killer 11-23-2005 01:26

omg omg it worked
thank you so much

Liquidz 05-23-2006 23:30

so what u did was a new model for all the weapons?

if so how the hell did u do that :P

i have been looking for some time.

Xanimos 05-24-2006 00:23

I have one made. Replaces all weapon models, configurable through ini file. It replaces v_ , p_ , and w_ models.

It's not a free plugin you must talk to me privately for it.

KCE 05-24-2006 02:00

I think this is what you're looking for; just needs to be ported to amxmodx:
http://djeyl.net/forum/index.php?showtopic=42303

Someone tried to port it but didn't quite finish it:
http://forums.alliedmods.net/showthread.php?t=15955

Just a warning if you plan on doing this: you should have fastdl or else it will take forever, and I mean forever to download the weapon models for the client. The more models you use the more the client has to download. Weapon models can get large to download when you have to download v, p, and w models.

Xanimos 05-24-2006 02:13

If you port it and try and release it you need permission from KRoT@L first

Lord_Destros 05-24-2006 02:57

There are quite a few plugins that auto change models............If your only looking for vmodels the one I ported isn't TOO bad (easy to configure). I tried porting Krotals change models but failed miserably. I may try again sometime in the future.


All times are GMT -4. The time now is 23:02.

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