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