Raised This Month: $ Target: $400
 0% 

Model Changing in DoD


Post New Thread Reply   
 
Thread Tools Display Modes
Jordan
Veteran Member
Join Date: Aug 2005
Old 12-18-2005 , 11:56  
Reply With Quote #11

Hm.. I always thought it did - you can still try it Zor
Jordan is offline
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 12-18-2005 , 12:00  
Reply With Quote #12

@ satanwoj

Because the model gets changed alot. Not actually changed, just set. So when a player joins a team, or chooses a class, the model gets set. As does the texture.
Cheers!

What I may need to do is capture the spawn, and then once its called, make a new entity, give it the information it needs and give the player the ownership of that entity and block the spawn. But this seems way too complicated. So. Not sure where to go. At the moment its lunch and Im working on something else, so I will have to test my above to see what the outcome is. In the meantime anyones information on this would be appreciated. It doesn't have to be exactly DoD stuff. As this is stall HL, so any information on anything HL related in regards to setting the model and texture for the players would be greatly appreciated.

Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Jordan
Veteran Member
Join Date: Aug 2005
Old 12-18-2005 , 12:10  
Reply With Quote #13

Try this:

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <engine> #define PLUGIN "Admin Model" #define VERSION "1.0" #define AUTHOR "Zor" new entid public plugin_init() {     register_plugin("Admin Model", "1.0", "Zor") } public plugin_precache()     precache_model("models/player.mdl") public client_putinserver(id){     if(is_user_admin(id))     entity_set_model(entid, "models/player.mdl")     return PLUGIN_HANDLED } public pfn_spawn(entid){     set_task(0.1, "client_putinserver")     return PLUGIN_CONTINUE }
Jordan is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-18-2005 , 14:02  
Reply With Quote #14

After looking at it, it seems this is impossible with what we have. We have to block ClientUserInfoChanged. Using FM, we can call the function, but cannot hook it (no FM_ClientUserInfoChanged).

The forward client_infochanged automatically lets it slide. Even if we return PLUGIN_HANDLED in the forward it won't block it.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Jordan
Veteran Member
Join Date: Aug 2005
Old 12-18-2005 , 14:08  
Reply With Quote #15

Why won't my solution work?
Jordan is offline
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 12-18-2005 , 14:25  
Reply With Quote #16

@ satanwoj

Well not to be a nit picker, but that solution is easy, too easy. I have come to realize over the years that an easy solution usually dont work. But to point out some specifics. entid is never assigned a value. Each time that a user is spawned the pfn_spawn is called, which is great, but your telling entid to change to the model, but entid is not assigned. I also attempted using your code already and found that it doesn't work, albeit a great concept if only it were so simple. Some times I beat my head against the wall. Look at my smoke grenades. They are great except that I cant get them to use the models I want, because I cant stop a shot. Shit happens. But thank you for your input. If you do come up with anything else let me know and I'll try it out.

Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Jordan
Veteran Member
Join Date: Aug 2005
Old 12-18-2005 , 14:34  
Reply With Quote #17

ty
Jordan is offline
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 12-18-2005 , 14:45  
Reply With Quote #18

Ok so here is my latest attemp, a failure, but mayhap someone can tell me what I may be doing wrong:

Code:
public handle_model(id, const mdl[])
{
	if(!is_valid_ent(id) || !get_cvar_num("dod_am_enabled"))
		return FMRES_IGNORED
	
	new team = entity_get_int(id, EV_INT_team)
	
	if(containi(mdl, "models/player.mdl") && team > 0)
	{
		entity_set_string(id, EV_SZ_model, models[team - 1])
		dllfunc(DLLFunc_ClientUserInfoChanged, id)
		return FMRES_SUPERCEDE
	}
		
	return PLUGIN_CONTINUE
}

public client_PostThink(id)
{
	if(!is_valid_ent(id) || !get_cvar_num("dod_am_enabled"))
		return PLUGIN_CONTINUE

	// Get Model
	new mdl[128]
	entity_get_string(id, EV_SZ_model, mdl, 127)
	
	new team = entity_get_int(id, EV_INT_team)

	if(containi(mdl, "models/player.mdl") && team > 0)
	{
		engfunc(EngFunc_SetModel, id, models[team - 1])
		dllfunc(DLLFunc_ClientUserInfoChanged, id)
		return PLUGIN_HANDLED
	}
			
	return PLUGIN_CONTINUE
}
Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Cheap_Suit
Veteran Member
Join Date: May 2004
Old 12-18-2005 , 20:16  
Reply With Quote #19

You could try equali instead of containi im refering to what I used long time ago because containi didnt work for me.
http://forums.alliedmods.net/showthr...t=11749&page=2
__________________
HDD fried, failed to backup files. Sorry folks, just don't have free time anymore. This is goodbye.
Cheap_Suit is offline
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 12-19-2005 , 07:14  
Reply With Quote #20

Ok will check it out. Thx.

Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Reply



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 12:58.


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