Topic: How to Edit Command /Channel Only Warcraft III
static int _handle_channel_command(t_connection * c, char const *text)
{
t_channel * channel;
text = skip_command(text);
if (text[0]=='\0')
{
message_send_text(c,message_type_info,c,"usage /channel <channel>");
return 0;
}
if (!conn_get_game(c)) {
if(strcasecmp(text,"Arranged Teams")==0)
{
message_send_text(c,message_type_error,c,"Channel Arranged Teams is a RESTRICTED Channel!");
return 0;
}
if (!(std::strlen(text) < MAX_CHANNELNAME_LEN))
{
snprintf(msgtemp, sizeof(msgtemp), "max channel name length exceeded (max %d symbols)", MAX_CHANNELNAME_LEN-1);
message_send_text(c,message_type_error,c,msgtemp);
return 0;
}
if ((channel = conn_get_channel(c)) && (strcasecmp(channel_get_name(channel),text)==0))
return 0; // we don't have to do anything, we are allready in this channel
if (conn_set_channel(c,text)<0)
conn_set_channel(c,CHANNEL_NAME_BANNED); /* should not fail */
if ((conn_get_clienttag(c) == CLIENTTAG_WARCRAFT3_UINT) || (conn_get_clienttag(c) == CLIENTTAG_WAR3XP_UINT))
conn_update_w3_playerinfo(c);
command_set_flags(c);
} else
message_send_text(c,message_type_error,c,"Command disabled while inside a game.");
return 0;
}
this script is join channel by using all client (chat,war3,etc) , and I want to make that not all clients can access this command.
client can access only warcraft 3, please help me change this script.
HarpyWar, Zeloit