←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

dwie przeróbki :) Prośba :P

Zablokowany

  • +
  • -
MafiaDL - zdjęcie MafiaDL 17.05.2008

1. plugin ustawia np o 1 w nocy wlonczał sie mapcykle nr 2 a od 7 rano mapcykle nr 1 ?

2. Sprawa potrzebuje pluginu admin_check :P ale komenda bedzie dostępna tylko dla ADMINÓW ! tylko admin moze wpisac w say /admin albo /adm ( najlepiej dwie opcje )

zwykly admin_check pewnie trzeba dodac Admin level A ? :P

#include <amxmodx>

/*---------------EDIT ME------------------*/
#define ADMIN_CHECK ADMIN_KICK

static const COLOR[] = "^x04" //green
static const CONTACT[] = ""
/*----------------------------------------*/

new maxplayers
new gmsgSayText

public plugin_init() {
	register_plugin("Admin Check", "1.51", "OneEyed")
	maxplayers = get_maxplayers()
	gmsgSayText = get_user_msgid("SayText")
	register_clcmd("say", "handle_say")
	register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER)
}

public handle_say(id) {
	new said[192]
	read_args(said,192)
	if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 )
		set_task(0.1,"print_adminlist",id)
	return PLUGIN_CONTINUE
}

public print_adminlist(user) 
{
	new adminnames[33][32]
	new message[256]
	new contactinfo[256], contact[112]
	new id, count, x, len
	
	for(id = 1 ; id <= maxplayers ; id++)
		if(is_user_connected(id))
			if(get_user_flags(id) & ADMIN_CHECK)
				get_user_name(id, adminnames[count++], 31)

	len = format(message, 255, "%s ADMINS ONLINE: ",COLOR)
	if(count > 0) {
		for(x = 0 ; x < count ; x++) {
			len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
			if(len > 96 ) {
				print_message(user, message)
				len = format(message, 255, "%s ",COLOR)
			}
		}
		print_message(user, message)
	}
	else {
		len += format(message[len], 255-len, "No admins online.")
		print_message(user, message)
	}
	
	get_cvar_string("amx_contactinfo", contact, 63)
	if(contact[0])  {
		format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact)
		print_message(user, contactinfo)
	}
}

print_message(id, msg[]) {
	message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
	write_byte(id)
	write_string(msg)
	message_end()
}
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 17.05.2008

#include <amxmodx> 

/*---------------EDIT ME------------------*/ 
#define ADMIN_CHECK ADMIN_KICK 

static const COLOR[] = "^x04" //green 
static const CONTACT[] = "" 
/*----------------------------------------*/ 

new maxplayers 
new gmsgSayText 

public plugin_init() { 
    register_plugin("Admin Check", "1.51", "OneEyed") 
    maxplayers = get_maxplayers() 
    gmsgSayText = get_user_msgid("SayText") 
    register_clcmd("say", "handle_say") 
    register_cvar("amx_contactinfo", CONTACT, FCVAR_SERVER) 
} 

public handle_say(id) { 
    new said[192] 
    read_args(said,192) 
    if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 ) 
        if(is_user_admin(id)) set_task(0.1,"print_adminlist",id) 
    return PLUGIN_CONTINUE 
} 

public print_adminlist(user) 
{ 
    new adminnames[33][32] 
    new message[256] 
    new contactinfo[256], contact[112] 
    new id, count, x, len 
    
    for(id = 1 ; id <= maxplayers ; id++) 
        if(is_user_connected(id)) 
            if(get_user_flags(id) & ADMIN_CHECK) 
                get_user_name(id, adminnames[count++], 31) 

    len = format(message, 255, "%s ADMINS ONLINE: ",COLOR) 
    if(count > 0) { 
        for(x = 0 ; x < count ; x++) { 
            len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"") 
            if(len > 96 ) { 
                print_message(user, message) 
                len = format(message, 255, "%s ",COLOR) 
            } 
        } 
        print_message(user, message) 
    } 
    else { 
        len += format(message[len], 255-len, "No admins online.") 
        print_message(user, message) 
    } 
    
    get_cvar_string("amx_contactinfo", contact, 63) 
    if(contact[0])  { 
        format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact) 
        print_message(user, contactinfo) 
    } 
} 

print_message(id, msg[]) { 
    message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) 
    write_byte(id) 
    write_string(msg) 
    message_end() 
}

powinno reagowac gdy admin wpisze komende
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 17.05.2008

thx a to by dalo rade zrobic

plugin ustawia np o 1 w nocy wlonczał sie mapcykle nr 2 a od 7 rano mapcykle nr 1 ?


#EDIT

BŁAD PRZY ROBIENIU .AMXX


/home/groups/amxmodx/tmp3/textf7yJLp.sma(25) : error 017: undefined symbol "is_user_admin"

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textf7yJLp.amx (compile failed).
Odpowiedz

  • +
  • -
Salamon - zdjęcie Salamon 17.05.2008

skompiluj lokalnie (u siebie xF)
Odpowiedz

  • +
  • -
Miczu - zdjęcie Miczu 17.05.2008

#include <amxmisc>

Dodaj to na poczatek, is_user_admin to jest funkcja samego amxx'a ale chyba trzeba to dopisac. ;>
Odpowiedz

  • +
  • -
Salamon - zdjęcie Salamon 17.05.2008

jezeli chce sie przez webcompiler to trzeba wszystko dopisywac, jezeli wystarczy nam lokalna kompilacja to jedyne co trzeba 'include' to te funkcje ktore wymagaja modulu, akurat tu nie wymaga i mozna lokalnie bez ale przez webcompilera trzeba wszystko
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 18.05.2008

luz +


plugin ustawia np o 1 w nocy wlonczał sie mapcykle nr 2 a od 7 rano mapcykle nr 1 ?


umie ktoś?
Odpowiedz

  • +
  • -
ESTCOBS - zdjęcie ESTCOBS 18.05.2008

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Godzine Mapcycle"
#define VERSION "1.0"
#define AUTHOR ""

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   wczytaj_mapcycle()
   return PLUGIN_CONTINUE
}

public wczytaj_mapcycle() {
   new today_str[8], cmd[48]
   get_time("%H",today_str,8)
   new today = str_to_num(today_str)

   if ((today >= 1) && (today < 7))
      format(cmd,48,"mapcyclefile mapcycle-noc.cfg",today)
   else if ((today >= 7) && (today < 1))
      format(cmd,48,"mapcyclefile mapcycle.cfg",today)

   server_cmd(cmd)

   return PLUGIN_HANDLED
}

Nie testowałem :]
Ale powinno być dobrze xD

mapcycle-noc.cfg i mapcycle.cfg do cstrike :]

Teraz Pan plusik ^^
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 18.05.2008

wiem gdzie dodac xD jak sprawdze dam plusika ;d

[ Dodano: 18-05-2008, 22:01 ]
albo teraz za chęci ;d
Odpowiedz

  • +
  • -
ESTCOBS - zdjęcie ESTCOBS 18.05.2008

Mafia :D Jakby nie działał to daj znać :D Bo jałmużny nie chce xD

// CLOSE THIS TOPIC
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 19.05.2008

Mafia :D Jakby nie działał to daj znać :D Bo jałmużny nie chce xD

// CLOSE THIS TOPIC


OK to za fatyge :P

dam znać na pw :P
Odpowiedz

  • +
  • -
Salamon - zdjęcie Salamon 19.05.2008

btw juz mowa byla o czyms takim:
else if ((today >= 7) && (today < 1))

godzina nie moze byc naraz i wieksza badz rowna 7 i mniejsza od 1 pomysl, tu musi byc || zamiast &&
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 19.05.2008

czyli ?

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Godzine Mapcycle"
#define VERSION "1.0"
#define AUTHOR ""

public plugin_init() {
   register_plugin(PLUGIN, VERSION, AUTHOR)
   wczytaj_mapcycle()
   return PLUGIN_CONTINUE
}

public wczytaj_mapcycle() {
   new today_str[8], cmd[48]
   get_time("%H",today_str,8)
   new today = str_to_num(today_str)

   if ((today >= 1) && (today < 7))
      format(cmd,48,"mapcyclefile mapcycle-noc.cfg",today)
   else if ((today >= 7) || (today < 1))
      format(cmd,48,"mapcyclefile mapcycle.cfg",today)

   server_cmd(cmd)

   return PLUGIN_HANDLED
}
Odpowiedz

  • +
  • -
Salamon - zdjęcie Salamon 19.05.2008

ta
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 19.05.2008

i w tym mapcycle cfg co wpisac mapy ? :P ktore mam w cstrike?
Odpowiedz

  • +
  • -
Salamon - zdjęcie Salamon 19.05.2008

prawdopodobnie
Odpowiedz

  • +
  • -
ESTCOBS - zdjęcie ESTCOBS 19.05.2008

.cfg możesz spokojnie zamienić na .txt xP
Odpowiedz
Zablokowany