Raised This Month: $ Target: $400
 0% 

Change model but not team in The Specialists Teamplay.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 12-18-2006 , 20:43   Change model but not team in The Specialists Teamplay.
Reply With Quote #1

I figured I'd start a new topic for this, since I have a specific goal in mind for a specific mod. I want to change the player's model in The Specialists Teamplay without changing their team.

Quote:
Originally Posted by XxAvalanchexX View Post
Code:
 #include <amxmodx>  #include <fakemeta>  public plugin_init()  {     register_forward(FM_PlayerPostThink,"fw_think");  }  public fw_think(id)  {     new info = engfunc(EngFunc_GetInfoKeyBuffer,id);     engfunc(EngFunc_SetClientKeyValue,id,info,"model","aswat");     return FMRES_IGNORED;  }
So I tested this code on a server with The Specialists Teamplay, and its nuts. The hud doesn't display, the 3, 2, 1 numbers before spawn appear randomly after spawn, the models aren't set to the model specified in the code, and you can only kill teammates. Oh, and you can't view your own model from third-person view. It's nuts.

So XxAvalanchexX, as I hope you're reading this, could you help me out with this? I'd love to come up with a method myself, but I don't know where to begin. I'd really appreciate some advice.

There are some events that might be useful:
Code:
Game registered user msgs:    msgid   size
TeamInfo                     84     -1
TeamScore                    85     -1
I just don't have the time right now to play around with it and I'm convinced there are methods I am completely unaware of.

Thanks for your time.
stupok is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-18-2006 , 22:58   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #2

Let me know how this works out.

Code:
 #include <amxmodx>  #include <fakemeta>  public plugin_init()  {     register_plugin("Model Test","0.10","Avalanche");     register_forward(FM_ClientUserInfoChanged,"fw_info");     register_forward(FM_PlayerPostThink,"fw_think");  }  public fw_info(id,buffer)  {     return FMRES_SUPERCEDE;  }  public fw_think(id)  {     new info = engfunc(EngFunc_GetInfoKeyBuffer,id);     engfunc(EngFunc_SetClientKeyValue,id,info,"model","gordon");     return FMRES_IGNORED;  }

Obviously I can't test it fully without a real server. It should make everyone look like gordon... players might not be able to change their name, I'm not sure. I'm still not sure how to detect whether or not the info change is called on model change.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-19-2006 , 00:30   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #3

I tested it, it works much better than the other one. I changed my name without a problem.

Now, as far as I know, the only problem left to solve is preventing the model change from changing the players' teams.
stupok is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-19-2006 , 02:07   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #4

Does their team change on the scoreboard? Only internally (it doesn't show up on the scoreboard but who you can kill is dictated by it)? Or both?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-19-2006 , 18:55   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #5

I have mp_teamlist with two teams. Using the code above, the models are all gordons but the team names are the same as listed by mp_teamlist. It splits up the teams by number, so they have an equal number of people on each team(adding bots). I can only kill the players of the opposing team.

Ok, some further testing makes it more confusing. When I switch teams, the scoreboard looks ok, but all my opponents have the green sprite over their heads like they are my teammates, and the scoreboard shows my team's name two times, instead of showing team1 and team2. Then I kill an opponent and the scoreboard is back to normal, and the green sprites that show allies are no longer present on my allies or opponents.

It's pretty confusing. Tomorrow I could spend some time testing this with you on my server if you're up to it.

Last edited by stupok; 12-19-2006 at 19:12.
stupok is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 12-20-2006 , 09:32   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #6

Code:
#include <amxmodx> new skin[33] new skinname[33][32] public plugin_init() {     register_plugin("Model Test", "0.10", "Orangutanz") } public client_infochanged(id) {     if (skin[id])     {         static model[32]         get_user_info(id, "model", model, 31)         if (equali(model, skinname[id]))             return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE }
You need to build a command but there we go, don't need FakeMeta to change player models
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-20-2006 , 17:08   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #7

So you can restrict him from changing to anything but the specified model, but what changes him to the specified model in the first place?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-20-2006 , 18:22   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #8

Orangutanz that is not relevant to my goal. I want to change the players' models to something they should not be in the first place, and be able to change them to not one, but several models. This should be done without actually changing their "model" info, so the game thinks they are one model but they are another.

Avalanche, what do you think about the situation? I'm thinking that I should intercept the TeamInfo and TeamScore messages and resend them with the teamnames I want them to have. I tried to write it for TeamInfo, but I'm not doing it correctly, here's my attempt:

Code:
register_message(84, "TeamInfo_function") } public TeamInfo_function() {     new id = read_data(1)     new zom[32], hum[32]     get_cvar_string("zombiemodelcvar", zom, 31)     get_cvar_string("humanmodelcvar", hum, 31)     if(is_user_bot(id))     {         message_begin(MSG_ALL, 84, {0.0, 0.0, 0.0}, id)         write_byte(id)         write_string(zom)         message_end()     }     else     {         message_begin(MSG_ALL, 84, {0.0, 0.0, 0.0}, id)         write_byte(id)         write_string(hum)         message_end()     } }

I don't think id should be passed in message_begin(), but I don't know what should be.
stupok is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-20-2006 , 23:41   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #9

MSG_ALL doesn't require any other info. You can just use "message_begin(MSG_ALL, 84)". I don't know the specifics on TS's TeamInfo or TeamScore, so you're sort of on your own here.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 12-20-2006 , 23:43   Re: Change model but not team in The Specialists Teamplay.
Reply With Quote #10

Thanks for the tip, I'll see what I can do.
stupok is offline
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 22:24.


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