Raised This Month: $ Target: $400
 0% 

How to detect player changeteam or model?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-04-2009 , 04:49   How to detect player changeteam or model?
Reply With Quote #1

question in title
__________________
xPaw is offline
zwfgdlc
Senior Member
Join Date: May 2006
Old 01-04-2009 , 05:34   Re: How to detect player changeteam or model?
Reply With Quote #2

try this.
PHP Code:
register_clcmd("jointeam","clcmd_jointeam");
register_clcmd("joinclass","clcmd_joinclass"); 
or
hook "TeamInfo" events and
cs_get_user_model

Last edited by zwfgdlc; 01-04-2009 at 05:45.
zwfgdlc is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 01-04-2009 , 08:58   Re: How to detect player changeteam or model?
Reply With Quote #3

PHP Code:
#include <amxmodx>

public plugin_init() 
    
register_event("TeamInfo""join_team","a");
    
public 
join_team()
{
    new 
index read_data);
    new 
team], name32 ], msg64 ];
    
get_user_nameindexname31 );
    
    
read_data2team);
    
    switch( 
team] )
    {
        case 
'C'formatex(msgcharsmax(msg), "%s joined CTs"name );
        case 
'T'formatex(msgcharsmax(msg), "%s joined Ts"name );
        case 
'S'formatex(msgcharsmax(msg), "%s joined Spects"name );
    }
    
    
client_print0print_chatmsg );
    return 
0;

EDIT: At change model, cache the model at reset hud and check it in prethink, i think...
__________________


Last edited by anakin_cstrike; 01-04-2009 at 09:12.
anakin_cstrike is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 01-04-2009 , 09:34   Re: How to detect player changeteam or model?
Reply With Quote #4

ok thanks but i think i can hook the model change, if he join same team, because the TeamInfo will be hooked
__________________
xPaw is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 01-04-2009 , 10:08   Re: How to detect player changeteam or model?
Reply With Quote #5

Quote:
Originally Posted by xPaw View Post
ok thanks but i think i can hook the model change, if he join same team, because the TeamInfo will be hooked
Yea but....there are 4 models at T and other 4 at CT, so the percentaje is very small...
__________________

anakin_cstrike is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-04-2009 , 10:15   Re: How to detect player changeteam or model?
Reply With Quote #6

http://www.amxmodx.org/funcwiki.php?go=func&id=8

Check the model each time this forward is called.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 06-05-2023 , 15:39   Re: How to detect player changeteam or model?
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
http://www.amxmodx.org/funcwiki.php?go=func&id=8

Check the model each time this forward is called.
which is the forward?

Last edited by MrPickles; 06-05-2023 at 15:40.
MrPickles is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 06-05-2023 , 19:48   Re: How to detect player changeteam or model?
Reply With Quote #8

Quote:
Originally Posted by MrPickles View Post
which is the forward?
this triggers whenever someone changes team
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Join Team Message", "0.2", "connorr")     register_logevent("JoinTeam", 3, "1=joined team") } public JoinTeam() {     new loguser[80], name[32]     read_logargv(0, loguser, 79)     parse_loguser(loguser, name, 31)     new id = get_user_index(name)    if( is_user_bot(id) && is_user_hltv(id))         return     new temp[2]     read_logargv(2, temp, 1)     switch(temp[0]){         case "U": ; // 0         case "T": ; // 1         case "C": ; // 2         case "S": ; // 3     } }
__________________
bigdaddy424 is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 06-06-2023 , 19:25   Re: How to detect player changeteam or model?
Reply With Quote #9

JoinTeam will trigger even if you change your appearance. if temp[0] is whether T or C use cs_get_user_model
__________________
bigdaddy424 is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 06-12-2023 , 10:13   Re: How to detect player changeteam or model?
Reply With Quote #10

Code:
#include amxmodx #define charsmin -1 new const filter[][] = {"jointeam", "joinclass", "model"} public client_command(client_index) {     if(is_user_connected(client_index))     {         new szArg[MAX_USER_INFO_LENGTH];         new szArgCmd[MAX_RESOURCE_PATH_LENGTH + MAX_RESOURCE_PATH_LENGTH], szArgCmd1[MAX_RESOURCE_PATH_LENGTH + MAX_RESOURCE_PATH_LENGTH];         read_args(szArg, charsmax(szArg));         read_argv(0,szArgCmd, charsmax(szArgCmd));         read_argv(1,szArgCmd1, charsmax(szArgCmd1));         for(new s;s < sizeof filter;s++)         if(containi(szArgCmd,filter[s]) != charsmin)         {             server_print "^n^n%n tried console command %s %s^n^n",client_index, szArgCmd, szArgCmd1             client_print 0, print_chat, "%n tried console command %s %s",client_index, szArgCmd, szArgCmd1             client_cmd 0, "spk ^"buttons/blip1.wav^""         }     }     return PLUGIN_CONTINUE; }
__________________

Last edited by DJEarthQuake; 06-19-2023 at 10:35.
DJEarthQuake 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 23:51.


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