AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Failed to do the vip printlist (https://forums.alliedmods.net/showthread.php?t=312382)

X3. 11-30-2018 10:36

Failed to do the vip printlist
 
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)
PHP Code:

public show_vips_online(id) {
    
    new 
bool:first truemessage[256], len
    
    
for (new i=0i<maxplayersi++) {
        
        if (
p_data[i][FLAGS]) {
            
            if (!
first) {
                
                
message[len++] = ','
                
message[len++] = ' '
            
}
            
message[len++] = '^4'
            
message[len] = EOS
            len 
+= get_user_name(imessage[len], charsmax(message)-len)
            
message[len++] = '^1'
            
message[len] = EOS
            
            first 
false
        
}
    }
    
    if (
first) {
        if (
is_amxmodx_new_versionclient_print_color(idid"^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_versionclient_print_color(idid"^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
PHP Code:

public show_vips_online(id
{
    new 
bool:first truemessage[256], len
    
    
for (new i=0i<maxplayersi++) 
    {
        
        if(
p_data[i][FLAGS] & AT_CHATTAG)
        {
            
            if (!
first) {
                
                
message[len++] = ','
                
message[len++] = ' '
            
}
            
message[len++] = '^4'
            
message[len] = EOS
            len 
+= get_user_name(imessage[len], charsmax(message)-len)
            
message[len++] = '^1'
            
message[len] = EOS
            
            first 
false
        
}
    }
    
    if (
first) {
        if (
is_amxmodx_new_versionclient_print_color(idid"^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_versionclient_print_color(idid"^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 truemessage[256], len
    
for (new i=0i<maxplayersi++)
    {
        if(
p_data[i][FLAGS] & AT_EXTRA_GRAVITY)
        {
            if(!
first)
            {
                
message[len++] = ','
                
message[len++] = ' '
            
}
            
message[len++] = '^4'
            
message[len] = EOS
            len 
+= get_user_name(imessage[len], charsmax(message)-len)
            
message[len++] = '^1'
            
message[len] = EOS
            first 
false
        
}
    }
    if(
first)
    {
        if (
is_amxmodx_new_versionclient_print_color(idid"^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_versionclient_print_color(idid"^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


All times are GMT -4. The time now is 07:30.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.