Raised This Month: $51 Target: $400
 12% 

Is this execution correct?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Krystek.
Member
Join Date: May 2022
Old 07-21-2022 , 03:44   Is this execution correct?
Reply With Quote #1

Is this execution correct?

PHP Code:
    new damage_better_items random_num(312);
    new 
damage_items         random_num(16);

    new 
perks_id[] = { 1234713 };

    for( new 
isizeof(perks_id); i++ ) {
        if( 
cod_get_user_perk(vid) == perks_id[i] ) {
            
log_amx("Better Durability: %i | PerkID %i"durability_perks[vid], perks_id[i]);
            
durability_perks[vid] -= (durability_perks[vid] > damage_better_items)? damage_better_itemsdurability_perks[vid];
            
log_amx("Better Durability: %i | PerkID %i"durability_perks[vid], perks_id[i]);

            return 
PLUGIN_CONTINUE;
        } 
    }

    for( new 
isizeof(perks_id); i++ ) {
        if( 
cod_get_user_perk(vid) != perks_id[i] ) {
            
log_amx("Durability: %i"durability_perks[vid], perks_id[i]);
            
durability_perks[vid] -= (durability_perks[vid] > damage_items)? damage_itemsdurability_perks[vid];
            
log_amx("Durability: %i"durability_perks[vid], perks_id[i]);

            return 
PLUGIN_CONTINUE;
        } 
    } 
The code is pretty loose so don't worry about log_amx and the like.

Last edited by Krystek.; 07-21-2022 at 03:45.
Krystek. is offline
 



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 16:58.


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