Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → How to Edit Command /Channel Only Warcraft III

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 2

1

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

2 (edited by Zeloit 30.12.2013 16:06)

Re: How to Edit Command /Channel Only Warcraft III

ex:
if ((conn_get_clienttag(c) == CLIENTTAG_WARCRAFT3_UINT) || (conn_get_clienttag(c) == CLIENTTAG_WAR3XP_UINT) || (conn_get_clienttag(c) == CLIENTTAG_STARCRAFT_UINT) || (conn_get_clienttag(c) == CLIENTTAG_BROODWARS_UINT) || (conn_get_clienttag(c) == CLIENTTAG_WARCIIBNE_UINT))

add clientag to that script

Posts: 2

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 1 guest, 0 registered users

forums.pvpgn.pro → [EN] The Source Code → How to Edit Command /Channel Only Warcraft III