- if(ze_get_vip_flags(id) & VIP_A | VIP_E)
- if(ze_get_vip_flags(id) && VIP_A | VIP_E)
- if(ze_get_vip_flags(id) & VIP_A || VIP_E)
- if(ze_get_vip_flags(id) & VIP_A & VIP_E)
ze_get_vip_flags
ze_get_vip_flags
What is the correct way to get more then one flag as a check.
I want them to have both of these flag before they can do something.
Here the 3 ways are same, use any one:
- if (ze_get_vip_flags(id) & (VIP_A|VIP_E))
- if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_E))
- if ((ze_get_vip_flags(id) & read_flags("ae"))
He who fails to plan is planning to fail
Do you know why this would not call the last else statement when a user is not a VIP it always calls the second one.
- public cmd_coins(id)
- {
- new nv = nvault_open(NV_NAME);
- if(nv == INVALID_HANDLE)
- {
- client_print(id,print_chat,"%s For the moment getting coins system is inactive..",TAG);
- return;
- }
- new txt_min[32],txt_coins[10];
- new coins = get_pcvar_num(cvar_coins),pminutes = get_pcvar_num(cvar_time);
- copy(txt_coins,charsmax(txt_coins),(coins==1)?"coin":"coins");
- build_time(pminutes,txt_min,charsmax(txt_min));
- if(g_player[id][ftime])
- {
- if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_E))
- {
- client_print(id,print_chat,"%s You have just received 150 free %s, get another in %s !",TAG,coins,txt_coins,txt_min);
- ze_set_escape_coins(id, ze_get_escape_coins(id) + 150);
- g_player[id][ftime]=false;
- nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
- return;
- }
- else if (ze_get_vip_flags(id) & VIP_A)
- {
- client_print(id,print_chat,"%s You have just received 100 free %s, get another in %s !",TAG,coins,txt_coins,txt_min);
- ze_set_escape_coins(id, ze_get_escape_coins(id) + 100);
- g_player[id][ftime]=false;
- nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
- return;
- }
- else
- {
- client_print(id,print_chat,"%s You have just received %d %s, get another in %s !",TAG,coins,txt_coins,txt_min);
- ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);
- g_player[id][ftime]=false;
- nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
- return;
- }
- }
- new user_time=get_systime()-g_player[id][mtime];
- new diff_min=(user_time<(pminutes*60))?pminutes-(user_time/60):pminutes;
- build_time(diff_min,txt_min,charsmax(txt_min));
- if(user_time>=(pminutes*60))
- {
- if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_E))
- {
- client_print(id,print_chat,"%s You have just received 150 free %s being a [VIP++] since %s passed !",TAG,txt_coins,txt_min);
- ze_set_escape_coins(id, ze_get_escape_coins(id) + 150);
- nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
- return;
- }
- else if (ze_get_vip_flags(id) & VIP_A)
- {
- client_print(id,print_chat,"%s You have just received 100 free %s being a [VIP+] since %s passed !",TAG,txt_coins,txt_min);
- ze_set_escape_coins(id, ze_get_escape_coins(id) + 100);
- nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
- return;
- }
- else
- {
- client_print(id,print_chat,"%s You have just received %d %s since %s passed ! [VIP] get an extra 100-150 coins!",TAG,coins,txt_coins,txt_min);
- ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);
- nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
- return;
- }
- }
- if ((ze_get_vip_flags(id) & VIP_A) && (ze_get_vip_flags(id) & VIP_E))
- {
- client_print(id,print_chat,"%s Retry again in %s to get 150 more %s !",TAG,txt_min,txt_coins);
- return;
- }
- else if(ze_get_vip_flags(id) & VIP_A)
- {
- client_print(id,print_chat,"%s Retry again in %s to get 100 more %s !",TAG,txt_min,txt_coins);
- return;
- }
- else
- {
- client_print(id,print_chat,"%s Retry again in %s to get %d more %s !",TAG,txt_min,coins,txt_coins);
- }
- nvault_close(nv);
- return;
- }
It should be called in case of first and second cases failed, i'm not sure but if second one called this means because you have flag a. Try make sure you don't have any flag then try.
He who fails to plan is planning to fail
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute
Sign in
Who is online
Users browsing this forum: No registered users and 2 guests