AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Setting models (https://forums.alliedmods.net/showthread.php?t=10993)

v3x 03-06-2005 18:25

Setting models
 
Hey, I tried to make a small plugin where it forces the user to use the model on the server, but it doesn't work.. For example, I want them to use v_LOCKscout.mdl as their scout model.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN    "Set models" #define AUTHOR    "v3x" #define VERSION    "1.00" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_event("CurWeapon","setModel","be") } public plugin_precache() {     precache_model("models/v_LOCKscout.mdl") } public setModel(id) {     new clip, ammo     new weapon = get_user_weapon(id,clip,ammo)     switch(weapon)     {         case CSW_SCOUT: entity_set_string(0,EV_SZ_viewmodel,"models/v_LOCKscout.mdl")     }     return PLUGIN_HANDLED }

Anyone know? :?

More 03-06-2005 19:08

Code:

entity_set_string(0,EV_SZ_viewmodel,"models/v_LOCKscout.mdl")
should be
Code:

entity_set_string(id,EV_SZ_viewmodel,"models/v_LOCKscout.mdl")

v3x 03-06-2005 19:16

Yea, I just tried that...still didn't work. The model is uploaded to /models if you're wondering, it downloads fine.

xeroblood 03-07-2005 10:37

From engine.inc:

Code:
/* Sets the model of an Entity. */ native entity_set_model(iIndex, const szModel[]);

Try using that function instead of entity_set_string()...

XxAvalanchexX 03-07-2005 16:24

xeroblood, you just kind of misinterpreted his entire question.

xeroblood 03-07-2005 17:08

:P shhhhh.... I do that from time to time... :D

v3x 03-08-2005 16:18

So.. Anyone? :P

XxAvalanchexX 03-08-2005 18:31

Nope, should work. Try experimenting with a set_task on the change to Scout of 0.1 seconds before setting the view model and see if that works. If it doesn't keep increasing the time by 0.1 seconds until you can get it to work. If you reach 1.0 seconds and it still doesn't work it probably isn't that.

v3x 03-08-2005 18:57

Should I set it as repeating or what?

XxAvalanchexX 03-09-2005 15:07

No.


All times are GMT -4. The time now is 14:12.

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