View Single Post
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 08-25-2018 , 08:28   Re: [CS:GO] surpressing event "player_team" will lead to not closing the teamselect p
Reply With Quote #5

I've tried this. Still don't get it!
I am not sure, if I am able to surpress the message without not sending the event. The message might be client related. Would htat be possible?

Code:
#include <sourcemod>
#include <cstrike>

/*
#Cstrike_game_join_spectators
#Cstrike_game_join_terrorist
#Cstrike_game_join_ct
*/

public void OnPluginStart()
{
    HookUserMessage(GetUserMessageId("TextMsg"), Event_TextMsg, true);
}

public Action Event_TextMsg(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init)
{
    char Text[128];
    PbReadString(msg, "params", Text, sizeof(Text), 0); 
    if(StrContains(Text, "#Cstrike_game_join_") != -1) // change saveplayer with your pattern
    {
        return Plugin_Handled;
    }
    return Plugin_Continue;
}
fragnichtnach is offline