AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Admin_level_f (https://forums.alliedmods.net/showthread.php?t=223649)

Shippuden 08-15-2013 17:22

Admin_level_f
 
Hi, i tried to make this "Human Class" only for ADMIN_LEVEL_F but still do not working..

Code:

public HumanClassMenu( id )
{
    if( zp_get_user_zombie( id ) || g_iSaveCurClass[ id ] != 0 )
    {
        print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tZombie." )
        return PLUGIN_HANDLED
    }
   
    if( zp_get_user_nemesis( id ) || g_iSaveCurClass[ id ] != 0 )
    {
        print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tNemesis." )
        return PLUGIN_HANDLED
    }
   
    if( zp_get_user_survivor( id ) || g_iSaveCurClass[ id ] != 0 )
    {
        print_chatColor( id, "\g[ZP] Nemozes izabrati klas kad si \tSurvivor." )
        return PLUGIN_HANDLED
    }
   
    new menu = menu_create( "\yIzaberi tvoj klas:", "menu_handler" )
   
    menu_additem( menu, "\wGhost - \r[ Extra Dmg & Disinfection & More Weapons ]", "1" )
   
    menu_setprop( menu, MPROP_EXIT, MEXIT_ALL )
    menu_display( id, menu, 0 )
   
    return PLUGIN_HANDLED
}

Code:

public menu_handler( id, menu, item )
{
    client_cmd(id, "spk zombie_plague/select");
   
    if(item == MENU_EXIT)
    {
        menu_destroy(menu);
        return PLUGIN_CONTINUE;
    }       
   
    item++;
   
    new ile = 0;
    for(new i=1; i<sizeof nazwy_klas; i++)
    {
        if(nalezy_do[i] == frakcja_gracza[id]){
            ile++;
        }
        if(ile == item)
        {
            item = i;
            break;
        }
    }
   
    if( item == Ghost && !(get_user_flags(id) & ADMIN_LEVEL_F ))
    {
        print_chatColor(id, "\g[ZP] Nemate pristup Premium Klasi, cena Premium klasi je 1 \tBOOST.");
        HumanClassMenu( id );
        return PLUGIN_HANDLED;
    }


Shippuden 08-15-2013 17:51

Re: Admin_level_f
 
Quote:

Originally Posted by Balck (Post 2014161)
PHP Code:

if( item == Ghost && !(get_user_flags(id) & ADMIN_LEVEL_F )) 

:arrow:
PHP Code:

if( item == Ghost && (get_user_flags(id) & ADMIN_LEVEL_F )) 

better send the full code

Not working.. :cry:

And yes here's the full code:

Spoiler

Black Rose 08-15-2013 23:18

Re: Admin_level_f
 
Add this and tell me the output:
Code:
server_print("%d, %d, %d", item, Ghost, (get_user_flags(id) & ADMIN_LEVEL_F)); if( item == Ghost && !(get_user_flags(id) & ADMIN_LEVEL_F )) // ...

Shippuden 08-16-2013 02:39

Re: Admin_level_f
 
Quote:

Originally Posted by Black Rose (Post 2014297)
Add this and tell me the output:
Code:
server_print("%d, %d, %d", item, Ghost, (get_user_flags(id) & ADMIN_LEVEL_F)); if( item == Ghost && !(get_user_flags(id) & ADMIN_LEVEL_F )) // ...


Not working......

ConnorMcLeod 08-16-2013 02:47

Re: Admin_level_f
 
PHP Code:

for(new i=1i<sizeof nazwy_klasi++) 

->

PHP Code:

for(new i=1i<=sizeof nazwy_klasi++) 

or :

PHP Code:

for(new i=0i<sizeof nazwy_klasi++) 


Shippuden 08-16-2013 02:59

Re: Admin_level_f
 
Quote:

Originally Posted by ConnorMcLeod (Post 2014346)

PHP Code:

for(new i=0i<sizeof nazwy_klasi++) 


It's working, but for all players not for ADMIN_LEVEL_F

ConnorMcLeod 08-16-2013 04:40

Re: Admin_level_f
 
nazwy_klas size is 2, but you only add 1 item to the menu...

Shippuden 08-16-2013 04:55

Re: Admin_level_f
 
Quote:

Originally Posted by ConnorMcLeod (Post 2014397)
nazwy_klas size is 2, but you only add 1 item to the menu...

I don't uderstand you?

Black Rose 08-16-2013 16:26

Re: Admin_level_f
 
Why are you PM'ing me when you haven't even done what I told you to.
Add that code and tell me what the console prints.

I can't try it out myself because I don't have ZP.
If you want this fixed, you'll have to put in this tiny effort and not just wait for others to fix it for you.
On top of that, the polish variable names doesn't help at all.


All times are GMT -4. The time now is 15:49.

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