- 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)
Resolved ze_get_vip_flags
- Mark
- Senior Member
- Posts: 258
- Joined: 6 Months Ago
- Location: Des Moines/USA
- Donation: 1x donated in total €10.00
- Has thanked: 6 times
- Been thanked: 19 times
- Age: 33
- Contact:
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.
- Raheem
- Mod Developer
- Posts: 1748
- Joined: 2 Years Ago
- Location: Egypt
- Has thanked: 30 times
- Been thanked: 87 times
- Age: 21
- Contact:
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"))
You don't know? Learn and you will know.
- Mark
- Senior Member
- Posts: 258
- Joined: 6 Months Ago
- Location: Des Moines/USA
- Donation: 1x donated in total €10.00
- Has thanked: 6 times
- Been thanked: 19 times
- Age: 33
- Contact:
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;
- }
- Raheem
- Mod Developer
- Posts: 1748
- Joined: 2 Years Ago
- Location: Egypt
- Has thanked: 30 times
- Been thanked: 87 times
- Age: 21
- Contact:
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.
You don't know? Learn and you will know.
Who is online
Users browsing this forum: No registered users and 0 guests