←  Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

Proszę przerobić Admin Check

naXe - zdjęcie naXe 09.04.2009

Witam.

Czy by mi mógł ktoś przerobić plugin Admin Check, aby po wpisaniu /admin, /admins, /adm wyświetlało się:
Admin jest wszędzie ?
Oczywiście, aby nie wyświetlało nicków adminów, tylko ten tekst.
Odpowiedz

  • +
  • -
emblaze - zdjęcie emblaze 09.04.2009

proszę sma:

#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 || contain(said, "/adm") != -1 ) 
        set_task(0.1,"print_adminlist",id) 
    return PLUGIN_CONTINUE 
} 
//pobrano z a.moze.warna.za.reklame.pl ?
public print_adminlist(user) 
{ 
    new adminnames[33][32] 
    new message[256] 
    new id, count, 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 Admin jest wszedzie ",COLOR) 
    print_message(user, message)
 

    

} 

print_message(id, msg[]) { 
    message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) 
    write_byte(id) 
    write_string(msg) 
    message_end() 
}
mi to działa ;-)
Odpowiedz

  • +
  • -
mgr inż. Pavulon - zdjęcie mgr inż. Pavulon 09.04.2009

mi to działa ;-)

ale skoro wyświetla tylko tekst to po co pozostawione sprawdzanie kto admin itd ?

tyle wystarczy:
#include <amxmodx>

new gmsgSayText

public plugin_init() {
    register_plugin("PLUGIN", "VERSION", "AUTHOR")
    gmsgSayText = get_user_msgid("SayText")
    register_clcmd("say", "handle_say")
}

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 message[64]

    format(message, 63, "^x04 Admin jest wszedzie ")
    print_message(user, message)
}

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

naXe - zdjęcie naXe 09.04.2009

A czy tu nie będzie wyświetlało:
nick admina Admin jest wszędzie ?
Odpowiedz

  • +
  • -
MafiaDL - zdjęcie MafiaDL 09.04.2009

Pavulon, jego kod nie.
Odpowiedz

  • +
  • -
emblaze - zdjęcie emblaze 09.04.2009

mój też nie ;-) tylko jest tam pare nie potrzebnych linijek :/
ps. pavulon sory za tą reklame ale jej nawet nie zauważyłem ;)
Odpowiedz

naXe - zdjęcie naXe 09.04.2009

To ja bym prosił przerobić albo zrobić (napisać) plugin tak aby po wpisaniu w say /admin wyświetlał się tekst "Admin jest wszędzie" bez adminów online
Odpowiedz

  • +
  • -
zer0. - zdjęcie zer0. 09.04.2009

#include <amxmodx>

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

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

new gmsgSayText

public plugin_init() {
    register_plugin("Admin Check", "1.51", "OneEyed")
    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 || contain(said, "/adm") != -1 )
        set_task(0.1,"print_adminlist",id)
    return PLUGIN_CONTINUE
}

public print_adminlist(user)
{
    new message[256]
    new contactinfo[256], contact[112]

    format(message, 255, "%s Admini sa wszedzie,COLOR)
    print_message(user, message)

   
    get_cvar_string("amx_contactinfo", contact, 63)
    if(contact[0])  {
        format(contactinfo, 111, "%s Kontakt GG z adminem serwera: %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() 
}
Do amxx.cfg dopisz amx_contactinfo "nr gg".
Tekst "Admin jest wszedzie" oraz "Kontakt GG z adminem serwera: nr gg" będzie wyświetlany na zielono.
Odpowiedz

  • +
  • -
kasza - zdjęcie kasza 09.04.2009

mozna przerobic aby bylo bez tego kontakt ?
Odpowiedz

  • +
  • -
silversurfer - zdjęcie silversurfer 09.04.2009

#include <amxmodx>



/*---------------EDIT ME------------------*/

#define ADMIN_CHECK ADMIN_KICK



static const COLOR[] = "^x04" //green

static const CONTACT[] = ""

/*----------------------------------------*/



new gmsgSayText



public plugin_init() {

    register_plugin("Admin Check", "1.51", "OneEyed")

    gmsgSayText = get_user_msgid("SayText")

    register_clcmd("say", "handle_say")

}



public handle_say(id) {

    new said[192]

    read_args(said,192)

    if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/admin") != -1 || contain(said, "/adm") != -1 )

        set_task(0.1,"print_adminlist",id)

    return PLUGIN_CONTINUE

}



public print_adminlist(user)

{

    new message[256]

    new contactinfo[256], contact[112]



    format(message, 255, "%s Admini sa wszedzie,COLOR)

    print_message(user, message)



        print_message(user)

    }

}



print_message(id, msg[]) {

    message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)

    write_byte(id)

    write_string(msg)

    message_end()

}
Odpowiedz

naXe - zdjęcie naXe 09.04.2009

silversurfer, błąd przy kompilowaniu:
/home/groups/amxmodx/tmp3/textdK2mg0.sma(13) : error 037: invalid string (possibly non-terminated string)
/home/groups/amxmodx/tmp3/textdK2mg0.sma(31) : error 037: invalid string (possibly non-terminated string)
/home/groups/amxmodx/tmp3/textdK2mg0.sma(34) : warning 217: loose indentation
/home/groups/amxmodx/tmp3/textdK2mg0.sma(34) : error 088: number of arguments does not match definition
/home/groups/amxmodx/tmp3/textdK2mg0.sma(43) : warning 203: symbol is never used: "COLOR"
/home/groups/amxmodx/tmp3/textdK2mg0.sma(43) : warning 203: symbol is never used: "CONTACT"

3 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textdK2mg0.amx (compile failed).
Odpowiedz

  • +
  • -
kasza - zdjęcie kasza 09.04.2009

taki sam mi wywala :?
Odpowiedz

  • +
  • -
mgr inż. Pavulon - zdjęcie mgr inż. Pavulon 09.04.2009

a w ogóle testował ktoś to co ja dałem ?
tam jest tylko info na zielono: "Admin jest wszedzie"
Odpowiedz

  • +
  • -
emblaze - zdjęcie emblaze 09.04.2009

Ja testowałem mój i pavulona. Oba działają z tą różnicą, że u mnie wystarczy wpisać /adm a u pavulona trzeba /admin. Ale obaj działają dobrze ;-)
Odpowiedz

naXe - zdjęcie naXe 09.04.2009

Pavulon, tak przed chwilą :)
Odpowiedz

  • +
  • -
kasza - zdjęcie kasza 09.04.2009

a w ogóle testował ktoś to co ja dałem ?


Wrzucilem na serwa :)
Odpowiedz

naXe - zdjęcie naXe 09.04.2009

Nie działa jak powinien jest tak:

ADMINS ONLIE: naXe
*DEAD*naXe: /admin
Admin jest wszedzie

A ja chcę bez:
ADMINS ONLIE: naXe
Odpowiedz

  • +
  • -
emblaze - zdjęcie emblaze 09.04.2009

naXe, w którym taki błąd ? O:)
Odpowiedz

naXe - zdjęcie naXe 09.04.2009

emblaze, w Pavulon'a
Odpowiedz

  • +
  • -
darkman - zdjęcie darkman 09.04.2009

emblaze, w Pavulon'a


kogoś robisz w konia, plugin pavulona nie ma prawa czegoś takiego wyświetlać. pewnie przekompilowałeś i nie nadpisałeś pliku w folderze plugins
Odpowiedz