Jump to content
GIGN Forum

Map Cikls


Recommended Posts

Skatijos so pluginu ieprieksejos postos, bet ta ari nespeju ustadit šo pluģinu vai ari kas vins skaitās

#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")
}

Ja kads zin ka kur kas jaraksta un ka jaliek vins un kur jaliek. :ermm:

EDIT: Varbut ir kads cits plugins kas automatiski parslēdz dienas map ciklu uz nakts?

Edited by skrim
Link to comment
Share on other sites

Šis arī automātiski pārslēdz.

Nu kopilet maku a kas vins jakompile, vins ir ka plugins ja.

Un vel kas kur ir jaliek ties 2 izveidotais map cikli

EDIT:

Paldies ka pateici ka vins jakompile, man viss sanaca, cerams ka vins automatiski parslegs uz dienas mapem.

Edited by skrim
Link to comment
Share on other sites

Kaut kas tomer nestrada, vins neparlec automatiski uz dienas mapem. <_<

paskataties varbut kas nepareizi salikts

#include <amxmodx>

new nightfrom,nightto
public plugin_init() {
register_plugin("Day/Night Mapcycle","0.7","Sh!nE*")

nightfrom = register_cvar("dnm_night_from","24") //24:00
nightto = register_cvar("dnm_night_to","8") //08: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 && (24 > from || hour < 8))
server_cmd("mapcyclefile mapcycle/night.txt")
else if(8 < to && hour > 24)
server_cmd("mapcyclefile mapcycle/day.txt")
}

Link to comment
Share on other sites

Kapēc Tev pēdējās 4 rindās ir kaut kādas konstantes ? Tur Tev vispār nekas nebija jālabo, jo mainīgie jau ir definēti. Tev bija tikai jāizmaina register_cvar() - jāieliek savas stundas, jānokompilē un jāaizmirst.

Link to comment
Share on other sites

Šitā jābūt! Šādi izskatās skaists kods :)

#include <amxmodx>

new nightfrom,nightto

public plugin_init()
{
   register_plugin("Day/Night Mapcycle","0.7","Sh!nE*")
// LABOT TIKAI ŠO
   nightfrom = register_cvar("dnm_night_from","24") 
   nightto = register_cvar("dnm_night_to","8")
// ZEMAAK NEKO LABOT NEDRIIKST
   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")
}

Link to comment
Share on other sites

EDIT: Vienkarshi sapratu savu kljuudu.. sorry:

#include <amxmodx>

new nightfrom,nightto

public plugin_init() {
    register_plugin("Day/Night Mapcycle","0.7","Sh!nE*")
    nightfrom = register_cvar("dnm_night_from","24")
    nightto = register_cvar("dnm_night_to","8")
    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)) || (from < to && (hour < from || hour > to)))
        server_cmd("mapcyclefile mapcycle/night.txt")
    else server_cmd("mapcyclefile mapcycle/day.txt")
}

jauztaisa mapee cstrike mape ar nosaukumu mapcycle, tur jauztaisa 2 faili - night.txt un day.txt. Tur salieciet savas mapes..

Edited by shine
Link to comment
Share on other sites

nu pameginasim tagad lai gan es cstrike to mapi taisiju un night un day ieksa vina bij ielicis :)

EDIT:

Nu ko uzstadiju tagad tikai jagaida rits, cerams stradas.

Neko nemainiju taja coda pedeja kuru ieliki, un cstrike mape izveidoju mapcycle/night.tx un day.tx

Edited by skrim
Link to comment
Share on other sites

ahh..

man kr4

es to mapcycle.sma

nocomplitetju

kr4 panjemu to mapcycle.amxx

un iemetu plugins mape un tad pierakstiju klat pie plugins.ini to mapcycle.amxx

Un man tgd kka visas mapes nextmapa ir ari tadas piem uzlikot fy_iceworld2k nextmap man atkal ir fy_iceworld2k

kadelj taa?

Kads var palidzet?

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...