AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   model change (https://forums.alliedmods.net/showthread.php?t=82637)

Cypher-Marx 12-27-2008 00:38

model change
 
How do I force a player to change his model with out using console commands? Any ideas? BTW The way this mod is not for CS 1.6 its for a mod called TS... I'm just wondering if there is any way to code it with out using console commands...

anakin_cstrike 12-27-2008 05:38

Re: model change
 
Change weapon model (search) or weapon ?

Cypher-Marx 12-27-2008 17:03

Re: model change
 
Quote:

Originally Posted by anakin_cstrike (Post 733899)
Change weapon model (search) or weapon ?

The players model, not a weapon at all. :D

Exolent[jNr] 12-27-2008 17:44

Re: model change
 
Search.

Cypher-Marx 12-27-2008 18:07

Re: model change
 
Quote:

Originally Posted by Exolent[jNr] (Post 734194)

... I did they only have Cstrike mods and i don't code for that game... So once again can someone please help me with this?

Anyone know why "entity_set_model(playerID, "models/model.mdl")" won't work?

Dores 12-27-2008 19:20

Re: model change
 
Quote:

Originally Posted by Cypher-Marx (Post 734201)
... I did they only have Cstrike mods and i don't code for that game... So once again can someone please help me with this?

Anyone know why "entity_set_model(playerID, "models/model.mdl")" won't work?

The player's model must be in a folder with the exact name as the model. I.e:
PHP Code:

entity_set_modelplayerID"models/player/custom_model/custom_model.mdl" ); 

EDIT: Oh wait, I'm not sure if it's for TS as well... Might be only for CS, but still give it a try.

Exolent[jNr] 12-27-2008 19:39

Re: model change
 
Since you can't use cs_set_user_model(), try this:
Code:
stock fm_set_user_model(client, const model[]) {     return engfunc(EngFunc_SetClientKeyValue, client, engfunc(EngFunc_GetInfoKeyBuffer, client), "model", model); }

Usage:
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> public plugin_precache() {     precache_model("models/player/newmodel/newmodel.mdl"); } public myfunction(client) {     fm_set_user_model(client, "newmodel"); } stock fm_set_user_model(client, const model[]) {     return engfunc(EngFunc_SetClientKeyValue, client, engfunc(EngFunc_GetInfoKeyBuffer, client), "model", model); }

Cypher-Marx 12-27-2008 22:38

Re: model change
 
Quote:

Originally Posted by Exolent[jNr] (Post 734230)
Since you can't use cs_set_user_model(), try this: Code:
stock fm_set_user_model(client, const model[]) { return engfunc(EngFunc_SetClientKeyValue, client, engfunc(EngFunc_GetInfoKeyBuffer, client), "model", model); }


Usage: Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> public plugin_precache() { precache_model("models/player/newmodel/newmodel.mdl"); } public myfunction(client) { fm_set_user_model(client, "newmodel"); } stock fm_set_user_model(client, const model[]) { return engfunc(EngFunc_SetClientKeyValue, client, engfunc(EngFunc_GetInfoKeyBuffer, client), "model", model); }

This works on free for all but in team games it changes your model right back to what its supposed to be... Anyway to get around this? and +karma to all who helped so far :D.

Hawk552 12-28-2008 19:48

Re: model change
 
Quote:

Originally Posted by Exolent[jNr] (Post 734230)
Since you can't use cs_set_user_model(), try this:
Code:
stock fm_set_user_model(client, const model[]) {     return engfunc(EngFunc_SetClientKeyValue, client, engfunc(EngFunc_GetInfoKeyBuffer, client), "model", model); }

Usage:
Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> public plugin_precache() {     precache_model("models/player/newmodel/newmodel.mdl"); } public myfunction(client) {     fm_set_user_model(client, "newmodel"); } stock fm_set_user_model(client, const model[]) {     return engfunc(EngFunc_SetClientKeyValue, client, engfunc(EngFunc_GetInfoKeyBuffer, client), "model", model); }

Why are you so obsessed with FM? You could shorten that code by a good 90% using this:

Code:
set_user_info(id,"model",model[])

Also, you can catch (using FM) when the player's model is set and block that. The hook would be:

Code:
register_forward(FM_SetModel,"ForwardSetModel")

In ForwardSetModel (or whatever you change it to), just return the value FMRES_SUPERCEDE.

Cypher-Marx 12-30-2008 04:38

Re: model change
 
Hawk that really doesn't help me in this case... Its a TS:Team server. This means that client console commands don't work for this one. I want to make it so I can force change someones model without TS changing it back to the models i wrote in my CFG. Can you help with that?


All times are GMT -4. The time now is 09:08.

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