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)
}
}