Raised This Month: $ Target: $400
 0% 

Setting models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-06-2005 , 18:25   Setting models
Reply With Quote #1

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?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
More
Member
Join Date: Nov 2004
Location: Internet
Old 03-06-2005 , 19:08  
Reply With Quote #2

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")
More is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-06-2005 , 19:16  
Reply With Quote #3

Yea, I just tried that...still didn't work. The model is uploaded to /models if you're wondering, it downloads fine.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-07-2005 , 10:37  
Reply With Quote #4

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()...
xeroblood is offline
Send a message via MSN to xeroblood
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-07-2005 , 16:24  
Reply With Quote #5

xeroblood, you just kind of misinterpreted his entire question.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 03-07-2005 , 17:08  
Reply With Quote #6

shhhhh.... I do that from time to time...
xeroblood is offline
Send a message via MSN to xeroblood
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-08-2005 , 16:18  
Reply With Quote #7

So.. Anyone?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-08-2005 , 18:31  
Reply With Quote #8

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.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-08-2005 , 18:57  
Reply With Quote #9

Should I set it as repeating or what?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-09-2005 , 15:07  
Reply With Quote #10

No.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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