conteo regresivo
#1
Como podria hacer un conteo regresivo
estoy haciendo un menu con sistema de admin gratis, quiciera poner cuanto tiempo le queda de prueba dejo el code
Código PHP:
public cmdMenuAdminPrueba(id)
{
    new 
menu[999], len;

    
len 0;
    
    
len += formatex(menu[len], sizeof menu len"\yPeriodo de prueba de PREMIUM:^n^n");
    
len += formatex(menu[len], sizeof menu len"\wPodras probar cuanto ganarias si fueses\r PREMIUM^n");
    
len += formatex(menu[len], sizeof menu len"\wGanaras x3 en PUNTOS/AMMOPACKS^n");
    
len += formatex(menu[len], sizeof menu len"\wPasado los 2 dias, este beneficio vencera^n");
    
len += formatex(menu[len], sizeof menu len"\wAdemas te regalamos 1.000.000 de Ammopacks y 500 Puntos ZM&HM^n^n");
    if (
gAdminbloqued[id])
    
len += formatex(menu[len], sizeof menu len"\wDias : \r%d \wHoras : \r%d \wMinutos : \r%d \wSegundos : \r%d^n^n"g_tiempo[id][3], g_tiempo[id][2], g_tiempo[id][1], g_tiempo[id][0])
    
    if (
gAdminVencido[id])
    
len += formatex(menu[len], sizeof menu len"\r1.\d Activar promocion^n");
    else if (
gAdminbloqued[id])
    
len += formatex(menu[len], sizeof menu len"\r1.\d Activar promocion^n");
    else
    
len += formatex(menu[len], sizeof menu len"\r1.\w Activar promocion^n");
    
    
len += formatex(menu[len], sizeof menu len"\r0.\w Salir");

    
    
show_menu(idKEYSMENUmenu, -1"Admin prueba");

}
public 
HandAdminPrueba(idkeysmenu)
{
    switch(
keys)
    {
        case 
0:{
    if (
gAdminVencido[id]){
        
Color(id"!g%s!y Ya has usado esta promocion"g_szModPrefix)
        
cmdMenuAdminPrueba(id)
    }
    else if (
gAdminbloqued[id]) {
        
Color(id"!g%s!y Ya estas usado esta promocion"g_szModPrefix)
        
cmdMenuAdminPrueba(id)
    }
    else {
        
gAdminbloqued[id] = true 
        g_iAmmoPacks
[id] += 1000000
        gPuntos
[id][0] += 500
        gPuntos
[id][1] += 500
        UpdateLevel
(id )
        
Color(id"!g%s!y has activado la promocion"g_szModPrefix)
        
set_task(1.0,"diashorasadmin",id+TASK_SUMAR2,_,_,"b")
        
    }

        }    
        case 
1..8:cmdMenuAdminPrueba(id)
        case 
9menu_destroy(menu)    
    }

public 
diashorasadmin(taskid){
    static 
id;id SUMAR_ID2
    
    
if(gAdminVencido[id]) return;
    
    if (
g_tiempo[id][3] == && g_tiempo[id][2] == && g_tiempo[id][1] == && g_tiempo[id][0] == 0){
        
Color(id"!g%s!y Ya vencio tu promocion"g_szModPrefix)
        
gAdminVencido[id] = true
    
}

    
g_tiempo[id][0]++
    
    if (
g_tiempo[id][0] == 60)
    {
        
g_tiempo[id][0] = 0
        g_tiempo
[id][1]++
    }
    if (
g_tiempo[id][1] == 60)
    {
        
g_tiempo[id][0] = 0
        g_tiempo
[id][1] = 0
        g_tiempo
[id][2]++
    }
    if (
g_tiempo[id][2] == 24)
    {
        
g_tiempo[id][0] = 0
        g_tiempo
[id][1] = 0
        g_tiempo
[id][2] = 0
        g_tiempo
[id][3]++
    }
   

https://steamcommunity.com/id/adriancek1ng/

Aquellos que te critican quieren verte distinto,
Por que ven en ti lo que ellos no serán jamás. Feel like a sir
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)