Jump to content
GIGN Forum

Need ****.sma !


Recommended Posts

Kads nevaretu ludzu uztaisit tadu plugini ja tas vispar ir iespejams ka tjipa noteikta laika hlds.exe izmanto citu map ciklu piemeram

no

1-7 mapcikl.txt

7-12 mapcikl2.txt

utt

katra mapcikla ieraktitu savas mape kadas gribi taja laika!

Tas loti noderetu pa nektim lai turas vairak cilveku , jo nektis vairak spele mazajas mapeS!

Link to comment
Share on other sites

#include <amxmodx> 


public load_mapcycle() 
{ 
    new hour[6];
    get_time("%H",hour,5)
    new hrs = str_to_num(hour)
    if( hrs < 9 )
    {
        server_cmd("mapcyclefile mcycl/rits.txt") 
    }
    if( hrs >= 10 )
    {
        server_cmd("mapcyclefile mcycl/diena.txt") 
    }
    if( hrs >= 23 )
    {
        server_cmd("mapcyclefile mcycl/vakars.txt")
    }
    return PLUGIN_HANDLED 
}

public plugin_init() 
{ 
    register_plugin("Mapcikls","0.1","Hops") 
    load_mapcycle() 
    return PLUGIN_CONTINUE 
}

Link to comment
Share on other sites

ja godigi neesmu vel izmeiginajis bet ka ir tads parasts mapcikl.txt un tur ir tas mapes ta izveido diena nakts rits .txt un tur sabaz tas mape.

velereiz paldies par so lielisko pluginu jo tas loti noder vakaros kad admini nav online!

Link to comment
Share on other sites

  • 1 month later...

#include <amxmodx> 


public load_mapcycle() 
{ 
    new hour[6];
    get_time("%H",hour,5)
    new hrs = str_to_num(hour)
    if( hrs < 9 )
    {
        server_cmd("mapcyclefile mcycl/rits.txt") 
    }
    if( hrs >= 10 )
    {
        server_cmd("mapcyclefile mcycl/diena.txt") 
    }
    if( hrs >= 23 )
    {
        server_cmd("mapcyclefile mcycl/vakars.txt")
    }
    return PLUGIN_HANDLED 
}

public plugin_init() 
{ 
    register_plugin("Mapcikls","0.1","Hops") 
    load_mapcycle() 
    return PLUGIN_CONTINUE 
}

a ka var zinat ka vins strada.

ja ja vins strada tad tas mapes paradas chosemap vai kur vins paradas ???????

Link to comment
Share on other sites

Optimized and more efficent.

#include <amxmodx>

new nightfrom,nightto

public plugin_init() {

register_plugin("Day/Night Mapcycle","0.7","Sh!nE*")

nightfrom = register_cvar("dnm_night_from","23") //23:00

nightto = register_cvar("dnm_night_to","10") //10:00

load_mapcycle()

}

public load_mapcycle() {

new hours[6]

get_time("%H",hours,5)

new hour = str_to_num(hours)

new from = get_pcvar_num(nightfrom)

new to = get_pcvar_num(nightto)

if(from > 24 || from < 0 || to < 0 || to > 24) set_fail_state("How many hours are in one day?")

if(from > to && (hour > from || hour < to))

server_cmd("mapcyclefile mapcycle/night.txt")

else if(hour < to && hour > from)

server_cmd("mapcyclefile mapcycle/day.txt")

}

Stundas tu vari rakstiit pilniigi jebkaadas (no 0 - 24) es paruupeejos ka tu vari nakti uzlikt no 23 lidz 10 un no 10 liidz 23 :).

Edited by shine
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...