Raised This Month: $ Target: $400
 0% 

doing both if and else why?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
whosyourdaddy
Senior Member
Join Date: Apr 2008
Old 08-10-2008 , 21:25   doing both if and else why?
Reply With Quote #1

ok what im trying to make it do is if they have a max_level then do the if satements but if there not in the lvl14.ini file then it should do the else statement but for some reason its doing both the if and else statements

Code:
public function(id){
     new file = fopen(adminfile,"r")
     new steamid[32],parsedid[32],parsedlevel[32], txtlen
 
     if(file_exists(adminfile))
     {     
 
           if(!file)
                 return;
 
           new readdata[128]
           new fsize = file_size(adminfile,1)
           for (new line=0;line<=fsize;line++)
           {     
                 get_user_authid(id,steamid,31)                  
                 read_file(adminfile,line,readdata,127,txtlen)
                 parse(readdata,parsedid,31,parsedlevel,31)
                 if(equali(parsedid,steamid))
                 {
                       MAX_LEVEL = str_to_num(parsedlevel)
 
                       if(MAX_LEVEL == 14 && p_data[id][P_XP] > 250000)
                       {
                             client_print(id,print_chat, "[sFx] You have reached your max level. Join our forums to unlock the rest of the levels. ")
                             p_data[id][P_XP] = 240000
                       }
                       else if(MAX_LEVEL == 15 && p_data[id][P_XP] > 300000)
                       {
                             client_print(id,print_chat, "[sFx] You have reached your max level. Join our forums to unlock the rest of the levels. ")
                             p_data[id][P_XP] = 290000
                       }
                       else if(MAX_LEVEL == 16 && p_data[id][P_XP] > 350000)
                       {
                             client_print(id,print_chat, "[sFx] You have reached your max level. Join our forums to unlock the rest of the levels. ")
                             p_data[id][P_XP] = 340000
                       }
                       else if(MAX_LEVEL == 17 && p_data[id][P_XP] > 400000)
                       {
                             client_print(id,print_chat, "[sFx] CONGRATS FROM THE [sFx] COMMUNITY ON YOUR LEVEL 17. ")
 
                       }
 
                 }                 
                 else 
                 {
 
                       if(p_data[id][P_XP] > 200000)
                       {
                             client_print(id,print_chat, "[sFx] You have reached your max level. Join our forums to unlock the rest of the levels. ")
                             p_data[id][P_XP] = 190000
                       }
                 }
 
           }     
           fclose(file)
     }
}

Last edited by whosyourdaddy; 08-10-2008 at 21:27.
whosyourdaddy 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 03:04.


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