VIP/SVIP Printlist

Ако имате затруднения при изработката/преработката на даден плъгин - пишете тук, ще се опитаме да ви помогнем!
Аватар
X3.!
Извън линия
Foreigner
Foreigner
Мнения: 31
Регистриран на: 30 Ное 2018, 20:46
Се отблагодари: 1 път

VIP/SVIP Printlist

Мнение от X3.! » 30 Ное 2018, 20:52

Hi,
Im using the VIP 1.9.1 vip system by aaarnas, I just wanted to edit something because there are many flags

So what I wanted to do is to add vip printlist and svip printlist, the deafult is only vip
register_clcmd("say /vips", "show_vips_online") , I added register_clcmd("say /svips", "show_svips_online")

The problem is I cannot check if user have this flags (according to the system custom flags from vips.ini)
So here is the default show_vips_online function (without my edits)

Код за потвърждение: Избери целия код

public show_vips_online(id) {
    
    new bool:first = true, message[256], len
    
    for (new i=0; i<maxplayers; i++) {
        
        if (p_data[i][FLAGS]) {
            
            if (!first) {
                
                message[len++] = ','
                message[len++] = ' '
            }
            message[len++] = '^4'
            message[len] = EOS
            len += get_user_name(i, message[len], charsmax(message)-len)
            message[len++] = '^1'
            message[len] = EOS
            
            first = false
        }
    }
    
    if (first) {
        if (is_amxmodx_new_version) client_print_color(id, id, "^4[ZMVIP] ^1%L...", id, "NO_VIP_ONLINE")
        else _client_print_color(id, "^4[ZMVIP] ^1%L...", id, "NO_VIP_ONLINE")
    }
    else {
        if (is_amxmodx_new_version) client_print_color(id, id, "^4[ZMVIP] ^1%L: %s.", id, "ONLINE_VIPS", message)
        else _client_print_color(id, "^4[ZMVIP] ^1%L: %s.", id, "ONLINE_VIPS", message)
    }
    
    print_admin_contacts(id)
    
    return PLUGIN_CONTINUE;
}  

What I did is

Код за потвърждение: Избери целия код

public show_vips_online(id) 
{
    new bool:first = true, message[256], len
    
    for (new i=0; i<maxplayers; i++) 
    {
        
        if(p_data[i][FLAGS] & AT_CHATTAG)
        {
            
            if (!first) {
                
                message[len++] = ','
                message[len++] = ' '
            }
            message[len++] = '^4'
            message[len] = EOS
            len += get_user_name(i, message[len], charsmax(message)-len)
            message[len++] = '^1'
            message[len] = EOS
            
            first = false
        }
    }
    
    if (first) {
        if (is_amxmodx_new_version) client_print_color(id, id, "^4[VIP] ^1%L...", id, "NO_VIP_ONLINE")
        else _client_print_color(id, "^4[VIP] ^1%L...", id, "NO_VIP_ONLINE")
    }
    else {
        if (is_amxmodx_new_version) client_print_color(id, id, "^4[VIP] ^1%L: %s.", id, "ONLINE_VIPS", message)
        else _client_print_color(id, "^4[VIP] ^1%L: %s.", id, "ONLINE_VIPS", message)
    }
    
    print_admin_contacts(id)
    
    return PLUGIN_CONTINUE;
}
public show_svips_online(id)
{
    new bool:first = true, message[256], len
    for (new i=0; i<maxplayers; i++)
    {
        if(p_data[i][FLAGS] & AT_EXTRA_GRAVITY)
        {
            if(!first)
            {
                message[len++] = ','
                message[len++] = ' '
            }
            message[len++] = '^4'
            message[len] = EOS
            len += get_user_name(i, message[len], charsmax(message)-len)
            message[len++] = '^1'
            message[len] = EOS
            first = false
        }
    }
    if(first)
    {
        if (is_amxmodx_new_version) client_print_color(id, id, "^4[SVIP] ^1%L...", id, "NO_SVIP_ONLINE")
        else _client_print_color(id, "^4[SVIP] ^1%L...", id, "NO_SVIP_ONLINE")
    }
    else
    {
        if (is_amxmodx_new_version) client_print_color(id, id, "^4[SVIP] ^1%L: %s.", id, "ONLINE_SVIPS", message)
        else _client_print_color(id, "^4[SVIP] ^1%L: %s.", id, "ONLINE_SVIPS", message)
    }
    
    print_admin_contacts(id)
    
    return PLUGIN_CONTINUE;
}  
The problem is, if I write /vips, it shows the vips and svips users, same for /svips
Note that vip user doesnt have svip flags

zm_vip_1.9.1_BETA.zip
(28.98 KiB) Свалено 127 пъти
zm_vip_1.9.1_BETA.zip
(28.98 KiB) Свалено 127 пъти
Последно промяна от X3.! на 30 Ное 2018, 21:01, променено общо 2 пъти.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

VIP/SVIP Printlist

Мнение от OciXCrom » 30 Ное 2018, 20:59

Please attach the main plugin so we can see what is going on. There are multiple version of it in the internet so I don't know which one you're using.

Please use [cоde] tags in the future for posting codes as they are the only one that allow you to select the entire code with one click and they don't spread the page.

Аватар
X3.!
Извън линия
Foreigner
Foreigner
Мнения: 31
Регистриран на: 30 Ное 2018, 20:46
Се отблагодари: 1 път

VIP/SVIP Printlist

Мнение от X3.! » 30 Ное 2018, 21:02

OciXCrom™ написа: 30 Ное 2018, 20:59 Please attach the main plugin so we can see what is going on. There are multiple version of it in the internet so I don't know which one you're using.

Please use [cоde] tags in the future for posting codes as they are the only one that allow you to select the entire code with one click and they don't spread the page.
Done
Sorry for posting it in this format, but I found only the inline code..

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

VIP/SVIP Printlist

Мнение от OciXCrom » 30 Ное 2018, 21:06

What are "svips" exactly? What did you set in vips.ini?

Аватар
X3.!
Извън линия
Foreigner
Foreigner
Мнения: 31
Регистриран на: 30 Ное 2018, 20:46
Се отблагодари: 1 път

VIP/SVIP Printlist

Мнение от X3.! » 30 Ное 2018, 22:05

OciXCrom™ написа: 30 Ное 2018, 21:06 What are "svips" exactly? What did you set in vips.ini?
Here are the flags of vip/svip, they are in the same ini file but with different flags.
svips is same as vips, but with different flags thats it

Q for vip, H for svip

; --- SVIP --- abcdefghijlmnopr

; --- VIP --- abcdefgijklmpqr

Q is AT_CHATTAG
H is AT_EXTRAGRAVITY

Добавено преди 56 минути 44 секунди:
Sorry if I didnt explain it so clear

What I want is to check if the user have the flag Q in vips.ini which is AT_CHATTAG ( note that in zv_get_user_flags native returns to the p_data)
if the user has Q flag, it show his name in vips online list
if user has H flag, it show his name in svips online list

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

VIP/SVIP Printlist

Мнение от OciXCrom » 30 Ное 2018, 22:18

Try checking the flag like this:

Код за потвърждение: Избери целия код

if (BIT(AT_EXTRA_GRAVITY) & p_data[i][FLAGS])

Аватар
X3.!
Извън линия
Foreigner
Foreigner
Мнения: 31
Регистриран на: 30 Ное 2018, 20:46
Се отблагодари: 1 път

VIP/SVIP Printlist

Мнение от X3.! » 30 Ное 2018, 23:34

Thank you
Solved

Заключено

Обратно към “Помощ в скриптирането”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 9 госта