Skip to forum content

You are not logged in. Please login or register.


Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 8

1

Topic: TMPOP

всем привет.
попробовал сделать так и добавить время. кто выдал и когда закончится  neutral
но почему то не выдает команду на всегда.

extern int account_set_auth_tmpop(t_account * account, char const * channelname, int val)
{
    char temp[256];

    if (!channelname)
    return account_set_boolattr(account, "BNET\\auth\\tmpop", val);

    std::sprintf(temp,"BNET\\auth\\tmpop\\%.100s",channelname);
    return account_set_boolattr(account, temp, val);
}

2

Re: TMPOP

ведь в про аккаунт есть tmpop на всегда big_smile
в channel.cpp

else if (account_get_auth_pro(acc, channel) == 1 || account_get_auth_pro(acc, NULL) == 1)
                newflags = MF_GAVEL;

MF_GAVEL это золотая рамка

3

Re: TMPOP

да знаю в про есть. но как можно сделать чтобы через команду /tmpop сделать отдельно?) roll  roll

4

Re: TMPOP

создать новую команду ) похожую на про

5 (edited by launcher 09.09.2016 19:14)

Re: TMPOP

кстати у меня /bot и /host не робит(((   у  тебя есть законченный свой? я ща тестирую с одним человеком

6

Re: TMPOP

а у меня норм работает ) вот законченный

static int _handle_host_command(t_connection * c, char const * text)
{
    t_account *    account;
    account = conn_get_account(c);
    t_account *    acc1;
    t_account *    acc2;
    t_account *    acc3;
    t_account *    acc4;
    t_connection * user;
    t_connection * unhost;
    char *    game_type;
    char *    game_mode;
    char *    game_name;
    char     t[MAX_MESSAGE_LEN];
    unsigned int i,j;
    char    arg1[256];
    char    arg2[256];
    char    arg3[256];
 char const * bot1="Uz.1";
 char const * bot2="Uz.2";
 char const * bot3="Uz.3";
 char const * bot4="Uz.4";
    std::strncpy(t, text, MAX_MESSAGE_LEN - 1);
    for (i=0; t[i]!=' ' && t[i]!='\0'; i++); 
    for (; t[i]==' '; i++); 

    for (j=0; t[i]!=' ' && t[i]!='\0'; i++) 
        if (j<sizeof(arg1)-1) arg1[j++] = t[i];
            arg1[j] = '\0';
 
    for (; t[i]==' '; i++); 
    for (j=0; t[i]!='\0'; i++) 
        if (j<sizeof(arg2)-1) arg2[j++] = t[i];
            arg2[j] = '\0';
 for (; t[i]==' '; i++); 
    for (j=0; t[i]!='\0'; i++) 
        if (j<sizeof(arg3)-1) arg3[j++] = t[i];
            arg3[j] = '\0';

            acc1 = accountlist_find_account(bot1);
            acc2 = accountlist_find_account(bot2);
            acc3 = accountlist_find_account(bot3);
            acc4 = accountlist_find_account(bot4);
    game_type = arg1;
    game_mode = arg2;
    game_name = arg3;
    if (arg1[0] =='\0') {
        message_send_text(c,message_type_info,c,"Используйте: /host [тип] [мод] [названия игры]");
    }
    else if (arg2[0] =='\0') {
        message_send_text(c,message_type_info,c,"Выберите мод");
        message_send_text(c,message_type_info,c,"Доступные моды:");
        message_send_text(c,message_type_info,c,"ap,sd,rd,ar");
    }
    
    
    else if (account_bots(account,NULL)==0) 
    {
        message_send_text(c,message_type_info,c,"Сначало выберите бота с командой /bot");
    }
    else if (account_get_auth_bot1host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    else if (account_get_auth_bot2host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    else if (account_get_auth_bot3host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    else if (account_get_auth_bot4host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    

    

    //custom
    else if (account_get_auth_cbot1host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    else if (account_get_auth_cbot2host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    else if (account_get_auth_cbot3host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    else if (account_get_auth_cbot4host(account,NULL)==1)
        {
        message_send_text(c,message_type_info,c,"У вас уже есть созданная игра!");
    }
    
    else if ((account_get_auth_bot1(account, NULL) == 1) || (account_get_auth_bot1on(acc1, NULL) == 0))
    {
        t_account * stats = accountlist_find_account( bot1 );
if (stats)
{
        t_connection * conn = account_get_conn(stats);
        if (conn)
            
                snprintf(msgtemp3, sizeof(msgtemp3), "!load dota");
        message_send_text(conn,message_type_whisper,conn, msgtemp3);
            snprintf(msgtemp, sizeof(msgtemp), "!pubby %s %s %s %s",account_get_name(conn_get_account(c)),game_type,game_mode,game_name);
        message_send_text(conn,message_type_whisper,conn, msgtemp);
        snprintf(msgtemp3, sizeof(msgtemp3), "!modprotected %s",game_mode);
        message_send_text(conn,message_type_whisper,conn, msgtemp3); 
        account_set_auth_bot1on(stats,NULL,1);
        account_set_auth_bot1host(account,NULL,1);
        snprintf(msgtemp4, sizeof(msgtemp4), "Ваша игра создана");
        message_send_text(c,message_type_info,c,msgtemp4);

    } else {
         if (!(user = connlist_find_connection_by_accountname(bot1))) {
        message_send_text(c,message_type_error,c,"Бот оффлайн");
}
}
        return 0;
    }
    else if ((account_get_auth_bot1(account, NULL) == 1) || (account_get_auth_bot1on(acc1, NULL) == 1))
    {
    message_send_text(c,message_type_info,c,"Бот занят!");
    }
    //bot2
    
    else if ((account_get_auth_bot2(account, NULL) == 1) || (account_get_auth_bot2on(acc2, NULL) == 0))
    {
        
        t_account * stats = accountlist_find_account( bot2 );
if (stats)
{
        t_connection * conn = account_get_conn(stats);
        if (conn)
            
                snprintf(msgtemp3, sizeof(msgtemp3), "!load dota");
        message_send_text(conn,message_type_whisper,conn, msgtemp3);
            snprintf(msgtemp, sizeof(msgtemp), "!pubby %s %s %s %s",account_get_name(conn_get_account(c)),game_type,game_mode,game_name);
        message_send_text(conn,message_type_whisper,conn, msgtemp);
                snprintf(msgtemp3, sizeof(msgtemp3), "!modprotected %s",game_mode);
        message_send_text(conn,message_type_whisper,conn, msgtemp3); 
        account_set_auth_bot2on(stats,NULL,1);
        account_set_auth_bot2host(account,NULL,1);
        snprintf(msgtemp4, sizeof(msgtemp4), "Ваша игра создана");
        message_send_text(c,message_type_info,c,msgtemp4);
        
    } else {
         if (!(user = connlist_find_connection_by_accountname(bot2))) {
        message_send_text(c,message_type_error,c,"Бот оффлайн");
}
}
    
        //
        return 0;
    }
    else if ((account_get_auth_bot2(account, NULL) == 1) || (account_get_auth_bot2on(acc2, NULL) == 1))
    {
    message_send_text(c,message_type_info,c,"Бот занят!");
    }
    //bot3
    
    else if ((account_get_auth_bot3(account, NULL) == 1) || (account_get_auth_bot3on(acc3, NULL) == 0))
    {
        t_account * stats = accountlist_find_account( bot3 );
if (stats)
{
        t_connection * conn = account_get_conn(stats);
        if (conn)
            
                snprintf(msgtemp3, sizeof(msgtemp3), "!load dota");
        message_send_text(conn,message_type_whisper,conn, msgtemp3);
            snprintf(msgtemp, sizeof(msgtemp), "!pubby %s %s %s %s",account_get_name(conn_get_account(c)),game_type,game_mode,game_name);
        message_send_text(conn,message_type_whisper,conn, msgtemp);
        snprintf(msgtemp3, sizeof(msgtemp3), "!modprotected %s",game_mode);
        message_send_text(conn,message_type_whisper,conn, msgtemp3); 
        account_set_auth_bot3on(stats,NULL,1);
        account_set_auth_bot3host(account,NULL,1);
        snprintf(msgtemp4, sizeof(msgtemp4), "Ваша игра создана");
        message_send_text(c,message_type_info,c,msgtemp4);
        
    } else {
         if (!(user = connlist_find_connection_by_accountname(bot3))) {
        message_send_text(c,message_type_error,c,"Бот оффлайн");
}
}

        //
        return 0;
    }
    else if ((account_get_auth_bot3(account, NULL) == 1) || (account_get_auth_bot3on(acc3, NULL) == 1))
    {
    message_send_text(c,message_type_info,c,"Бот занят!");
    }
        //bot4
    else if ((account_get_auth_bot4(account, NULL) == 1) || (account_get_auth_bot4on(acc4, NULL) == 0))
    {
        
        t_account * stats = accountlist_find_account( bot4 );
if (stats)
{
        t_connection * conn = account_get_conn(stats);
        if (conn)
            
                snprintf(msgtemp3, sizeof(msgtemp3), "!load dota");
        message_send_text(conn,message_type_whisper,conn, msgtemp3);
            snprintf(msgtemp, sizeof(msgtemp), "!pubby %s %s %s %s",account_get_name(conn_get_account(c)),game_type,game_mode,game_name);
        message_send_text(conn,message_type_whisper,conn, msgtemp);
        snprintf(msgtemp3, sizeof(msgtemp3), "!modprotected %s",game_mode);
        message_send_text(conn,message_type_whisper,conn, msgtemp3); 
        account_set_auth_bot4on(stats,NULL,1);
        account_set_auth_bot4host(account,NULL,1);
        snprintf(msgtemp4, sizeof(msgtemp4), "Ваша игра создана");
        message_send_text(c,message_type_info,c,msgtemp4);
        
    } else {
         if (!(user = connlist_find_connection_by_accountname(bot4))) {
        message_send_text(c,message_type_error,c,"Бот оффлайн");
}
}

        //
        

        return 0;
    }



  return 0;
}

7

Re: TMPOP

а /bot тот же?

8

Re: TMPOP

в /bot нет изменений
у меня всё норм работает (правда у меня нету рабочего бота с mysql, хотел сделать /stats как у икапа  big_smile )

Posts: 8

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 0 guests, 0 registered users