Raised This Month: $51 Target: $400
 12% 

Team Change Event ?


Post New Thread Reply   
 
Thread Tools Display Modes
GuskiS
Veteran Member
Join Date: Aug 2007
Location: Latvia
Old 07-18-2014 , 17:33   Re: Team Change Event ?
Reply With Quote #11

What about if you are making an API of some sort? You change team in main plugin, but need to hook it on other. You could use forward ofcourse, but why if there is already an event?

Also, I would do something like this (untested):
PHP Code:
stock change_player_team(idteam)
{
    static 
g_pMsgTeamInfo;
    if(!
g_pMsgTeamInfo)
        
g_pMsgTeamInfo get_user_msgid("TeamInfo");

    
cs_set_user_team(idCsTeams:team);
    
emessage_begin(MSG_BROADCASTg_pMsgTeamInfo);
    
ewrite_byte(id);
    switch(
team)
    {
        case 
0:ewrite_string("UNASSIGNED");
        case 
1:ewrite_string("TERRORIST");
        case 
2:ewrite_string("CT");
        case 
3:ewrite_string("SPECTATOR");
    }
    
emessage_end();

__________________
Finished mods:
Trouble in Terrorist Town
MurderMod
The Hidden
Cowboys vs Indians
JailBreak Supreme
Survival Madness

Last edited by GuskiS; 07-18-2014 at 17:34.
GuskiS is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-18-2014 , 19:07   Re: Team Change Event ?
Reply With Quote #12

Not all thing created by plugins will be hooked the same was as if it were the actual server doing it. This is the case with engclient_cmd() and why I suggested the amxclient_cmd() which is now implemented in the dev version.
__________________

Last edited by fysiks; 07-18-2014 at 19:08.
fysiks 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 20:28.


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