Raised This Month: $ Target: $400
 0% 

cs_set_user_team & TeamInfo Issue


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Netsys
Senior Member
Join Date: Feb 2010
Old 07-31-2015 , 12:23   cs_set_user_team & TeamInfo Issue
Reply With Quote #1

When i change of team with cs_set_user_team the scoreboard is updated but i can't hook the message TeamInfo when change of team.

AMX Version
PHP Code:
AMX Mod X 1.8.3-dev+4841 (http://www.amxmodx.org)
Authors:
    
David "BAILOPAN" AndersonPavol "PM OnoTo" Marko
    Felix 
"SniperBeamer" GeyerJonny "Got His Gun" Bergstrom
    Lukasz 
"SidLuke" WlasinskiChristian "Basic-Master" Hammacher
    Borja 
"faluco" FerrerScott "DS" Ehlert
Compiled
Jul 31 2015 06:44:40
Built from
https://github.com/alliedmodders/amxmodx/commit/6d7daf7
Build ID4841:6d7daf7
Core mode
JIT+ASM32 
Plugin to test:
PHP Code:
#include <amxmodx>
#include <cstrike>

new const names[][] = {"UNA""T""CT""SPECT"};

public 
plugin_init()
{
    
register_clcmd("say /team""clcmdTeam");
    
    
register_event("TeamInfo""eventTeamInfo""a");
    
register_message(get_user_msgid("TeamInfo"), "messageTeamInfo");
}

public 
client_putinserveriPlayerID )
{
    
log_to_file("cstrike.log""[client_putinserver] Player connected");
}

public 
client_disconnectiPlayerID )
{
    
log_to_file("cstrike.log""[client_disconnect] Player disconnected");
}

public 
clcmdTeamiPlayerID )
{
    
log_to_file("cstrike.log""[clcmdTeam] Pre Team: %s"names[_cs_get_user_team(iPlayerID)]);
    
cs_set_user_team(iPlayerIDcs_get_user_team(iPlayerID) == CS_TEAM_T CS_TEAM_CT CS_TEAM_TCS_DONTCHANGEtrue);
    
log_to_file("cstrike.log""[clcmdTeam] Post Team: %s"names[_cs_get_user_team(iPlayerID)]);
}

public 
eventTeamInfo()
{
    new 
szTeam[2];
    
read_data(2szTeamcharsmax(szTeam));
    
    
log_to_file("cstrike.log""[eventTeamInfo] szTeam: %s"szTeam);
}

public 
messageTeamInfo()
{
    new 
szTeam[2];
    
get_msg_arg_string(2szTeamcharsmax(szTeam));
    
log_to_file("cstrike.log""[messageTeamInfo] szTeam: %s"szTeam);

log:
PHP Code:
[messageTeamInfoszTeamU
[eventTeamInfoszTeamU
[client_putinserverPlayer connected
[messageTeamInfoszTeamU
[messageTeamInfoszTeamT
[eventTeamInfoszTeamT
[messageTeamInfoszTeamT
[eventTeamInfoszTeamT
[clcmdTeamPre TeamT
[clcmdTeamPost TeamCT
[clcmdTeamPre TeamCT
[clcmdTeamPost TeamT
[client_disconnectPlayer disconnected
[messageTeamInfoszTeamU
[eventTeamInfoszTeam

Last edited by Netsys; 07-31-2015 at 12:24.
Netsys is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-31-2015 , 12:49   Re: cs_set_user_team & TeamInfo Issue
Reply With Quote #2

Well, it's originally by design. There is no issue. I guess for TeamInfo this is useful to have an hookable message
__________________
Arkshine is offline
Netsys
Senior Member
Join Date: Feb 2010
Old 08-01-2015 , 11:04   Re: cs_set_user_team & TeamInfo Issue
Reply With Quote #3

is there any way to detect when a player changes teams with cs_set_user_team?
Netsys 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 08:01.


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