Raised This Month: $ Target: $400
 0% 

Improving and optimizing this thing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-29-2022 , 19:34   Re: Improving and optimizing this thing
Reply With Quote #1

I didnt realize you also had separate flags for each, I added that to the above code. If you have any questions on using this, let me know.
__________________
Bugsy is offline
Krystek.
Member
Join Date: May 2022
Old 05-29-2022 , 19:50   Re: Improving and optimizing this thing
Reply With Quote #2

Quote:
Originally Posted by Bugsy View Post
I didnt realize you also had separate flags for each, I added that to the above code. If you have any questions on using this, let me know.
PHP Code:
@MENU_KNIFE(id) {
    
    new 
Knife menu_create(fmt("\dSkins \rKnifes\d"), "@MENU_KNIFE_Handler")
    
    for(new 
0sizeof(KnifeNames); i++){
        if(
FlagsKnife[i] == ADMIN_LEVEL_H){
            
menu_additem(Knife fmt("\d» %s %s"get_user_flags(id) & ADMIN_LEVEL_H "\y(VIP)\w" "\d(VIP)\d"KnifeNames[i]), ""FlagsKnife[i], -1);
        }
        if(
FlagsKnife[i] == ADMIN_LEVEL_D){
            
menu_additem(Knife fmt("\d» %s %s"get_user_flags(id) & ADMIN_LEVEL_D "\y(MODEL MIKU)\w" "\d(MODEL MIKU)\d"KnifeNames[i]), ""FlagsKnife[i], -1);            
        }
        if(
FlagsKnife[i] == 0){
            
menu_additem(Knife fmt("\d»\w %s"KnifeNames[i]), ""FlagsKnife[i], -1);
        }
    }
    
menu_setprop(KnifeMPROP_EXITNAME"Exit");

    
menu_display(idKnife);

    return 
PLUGIN_HANDLED;
}
@
MENU_KNIFE_Handler(idKnifeitem) {
    if (
item == MENU_EXIT) {
        
menu_destroy(Knife);
        return 
PLUGIN_HANDLED;
    }
    
    if(
FlagsKnife[item] == 0){
        
player_item[1][id] = item
    
}
    else if(
FlagsKnife[item] > && get_user_flags(id) & FlagsKnife[item]){
        
player_item[1][id] = item
    
}

    
Set_Model(id);
    
SaveModels(id)    

    
menu_destroy(Knife);

    return 
PLUGIN_HANDLED;

How do I apply this to this code?
Do I understand correctly?

HTML Code:
for(new i = 0; i < sizeof(Knives); i++) {
 KnivesItems[ Knives ][ ItemData ]
Am I wrong? This code is so complicated that I don't know exactly how to do it ...

Last edited by Krystek.; 05-29-2022 at 19:50.
Krystek. 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 21:22.


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