Страница 1 от 1

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 20:52
от X3.!
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) Свалено 128 пъти
zm_vip_1.9.1_BETA.zip
(28.98 KiB) Свалено 128 пъти

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 20:59
от OciXCrom
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.

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 21:02
от X3.!
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..

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 21:06
от OciXCrom
What are "svips" exactly? What did you set in vips.ini?

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 22:05
от X3.!
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

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 22:18
от OciXCrom
Try checking the flag like this:

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

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

VIP/SVIP Printlist

Публикувано на: 30 Ное 2018, 23:34
от X3.!
Thank you
Solved