Raised This Month: $ Target: $400
 0% 

Admin_level_f


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shippuden
Junior Member
Join Date: Aug 2013
Old 08-15-2013 , 17:22   Admin_level_f
Reply With Quote #1

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 is offline
Old 08-15-2013, 17:35
Balck
This message has been deleted by Balck. Reason: wrong X_X
Shippuden
Junior Member
Join Date: Aug 2013
Old 08-15-2013 , 17:51   Re: Admin_level_f
Reply With Quote #3

Quote:
Originally Posted by Balck View Post
PHP Code:
if( item == Ghost && !(get_user_flags(id) & ADMIN_LEVEL_F )) 

PHP Code:
if( item == Ghost && (get_user_flags(id) & ADMIN_LEVEL_F )) 
better send the full code
Not working..

And yes here's the full code:

Spoiler
Shippuden is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-15-2013 , 23:18   Re: Admin_level_f
Reply With Quote #4

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 )) // ...
__________________
Black Rose is offline
Shippuden
Junior Member
Join Date: Aug 2013
Old 08-16-2013 , 02:39   Re: Admin_level_f
Reply With Quote #5

Quote:
Originally Posted by Black Rose View Post
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......
Shippuden is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2013 , 02:47   Re: Admin_level_f
Reply With Quote #6

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++) 
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-16-2013 at 02:48.
ConnorMcLeod is offline
Shippuden
Junior Member
Join Date: Aug 2013
Old 08-16-2013 , 02:59   Re: Admin_level_f
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post

PHP Code:
for(new i=0i<sizeof nazwy_klasi++) 
It's working, but for all players not for ADMIN_LEVEL_F
Shippuden is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2013 , 04:40   Re: Admin_level_f
Reply With Quote #8

nazwy_klas size is 2, but you only add 1 item to the menu...
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-16-2013 , 16:26   Re: Admin_level_f
Reply With Quote #9

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.
__________________

Last edited by Black Rose; 08-16-2013 at 16:30.
Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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