←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Co jest źle? Plugin od wyłączania pluginów

  • +
  • -
Batonik's Photo Batonik 07.12.2013

Witam, posiadam taki oto kod:

#include <amxmodx>
public plugin_init()
{
	    register_plugin("noc czy dzien", "1,0", "wizu")
	    wczytaj()
}
public  wczytaj()
{
	    new today_str[8]
	    get_time("%H",today_str,8)
	    new today = str_to_num(today_str)
	    if ((today >= 21) || (today < 10))
			    pause("ac","deagsmapmanager.amxx")
                unpause("ac","mapchooser4.amxx")
	    else
			    unpause("ac","deagsmapmanager.amxx")
                pause("ac","mapchooser4.amxx")
}

I wywala błędy:

33.sma(14) : warning 217: loose indentation
33.sma(15) : warning 217: loose indentation
33.sma(15) : error 029: invalid expression, assumed zero
33.sma(16) : warning 217: loose indentation
33.sma(17) : warning 217: loose indentation

1 Error.
Could not locate output file 33.amxx (compile failed).

a przy tym kodzie działa:

#include <amxmodx>
public plugin_init()
{
	    register_plugin("noc czy dzien", "1,0", "wizu")
	    wczytaj()
}
public  wczytaj()
{
	    new today_str[8]
	    get_time("%H",today_str,8)
	    new today = str_to_num(today_str)
	    if ((today >= 21) || (today < 10))
			    pause("ac","deagsmapmanager.amxx")
	    else
			    unpause("ac","deagsmapmanager.amxx")
}

Edited by Batonik, 07.12.2013 14:36.
Quote

  • +
  • -
Wielkie Jol's Photo Wielkie Jol 07.12.2013

 

Musisz dodać klamry, jako, że jest więcej niż jedna funkcja do wykonania

#include <amxmodx>
public plugin_init()
{
    register_plugin("noc czy dzien", "1,0", "wizu")
    wczytaj()
}
public  wczytaj()
{
    new today_str[8]
    get_time("%H",today_str,8)
    new today = str_to_num(today_str)
    if ((today >= 21) || (today < 10)){
        pause("ac","deagsmapmanager.amxx")
        unpause("ac","mapchooser4.amxx")
    }
    else {
        unpause("ac","deagsmapmanager.amxx")
        pause("ac","mapchooser4.amxx")
    }
}

 


Musisz dodać klamry, jako, że jest więcej niż jedna funkcja do wykonania

#include <amxmodx>
public plugin_init()
{
    register_plugin("noc czy dzien", "1,0", "wizu")
    wczytaj()
}
public  wczytaj()
{
    new today_str[8]
    get_time("%H",today_str,8)
    new today = str_to_num(today_str)
    if ((today >= 21) || (today < 10)){
        pause("ac","deagsmapmanager.amxx")
        unpause("ac","mapchooser4.amxx")
    }
    else {
        unpause("ac","deagsmapmanager.amxx")
        pause("ac","mapchooser4.amxx")
    }
}

widać różnicę?

 

     if ((today >= 21) || (today < 10))
             pause("ac","deagsmapmanager.amxx")
     else
             unpause("ac","deagsmapmanager.amxx")
}

 

 

 

    if ((today >= 21) || (today < 10)){
        pause("ac","deagsmapmanager.amxx")
        unpause("ac","mapchooser4.amxx")
    }
    else {
        unpause("ac","deagsmapmanager.amxx")
        pause("ac","mapchooser4.amxx")
    }
}

Edited by Wielkie Jol, 07.12.2013 18:28.
Quote

  • +
  • -
Batonik's Photo Batonik 07.12.2013

Widać, dzięki :)

Quote