Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
CoD Stary

Nowa komendakomenda /premium

CoD Stary

  • Zamknięty Temat jest zamknięty
4 odpowiedzi w tym temacie

#1 krysteksulek

    Zaawansowany

  • Zbanowany

Reputacja: 17
Początkujący

  • Postów:133
  • GG:
  • Imię:Krystek
  • Lokalizacja:Ateny
Offline

Napisano 29.01.2011 22:45

Witam, jak zrobić w CoD Modzie [Starym] komende /premium, ktora pokazywala informacje z graczami premium na serwerze?

#2 V!p3r

    Zaawansowany

  • Użytkownik

Reputacja: 13
Początkujący

  • Postów:90
  • Steam:steam
  • Imię:Tomek
  • Lokalizacja:Bojanowo
Offline

Napisano 29.01.2011 22:57

#include <amxmodx>

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

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

new maxplayers
new gmsgSayText

public plugin_init() {
register_plugin("Premium Check", "1.0", "OneEyed & V!p3r")
maxplayers = get_maxplayers()
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, "premium") != -1 ) || contain(said, "/premium") != -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 Gracze Premium: ",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, "Brak Graczy Premium.")
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()
}


Proszę :)
Nie testowany, jak będą problemy - pisz:)

Przerobiłem Admin Check

Użytkownik V!p3r edytował ten post 29.01.2011 22:57

  • +
  • -
  • 1

#3 krysteksulek

    Zaawansowany

  • Autor tematu
  • Zbanowany

Reputacja: 17
Początkujący

  • Postów:133
  • GG:
  • Imię:Krystek
  • Lokalizacja:Ateny
Offline

Napisano 30.01.2011 12:11

Dzięki, działa :).

#4 Sevox

    Zaawansowany

  • Użytkownik

Reputacja: 4
Nowy

  • Postów:84
  • Imię:YYYYYY
  • Lokalizacja:YYYYY
Offline

Napisano 30.01.2011 13:43

To nie działa, wywala błędy, prosiłbym o naprawioną wersję.
  • +
  • -
  • 0

#5 krysteksulek

    Zaawansowany

  • Autor tematu
  • Zbanowany

Reputacja: 17
Początkujący

  • Postów:133
  • GG:
  • Imię:Krystek
  • Lokalizacja:Ateny
Offline

Napisano 30.01.2011 20:06

Masz, sam sobie poprawiłem :).

#include <amxmodx> 
 
/*---------------EDIT ME------------------*/ 
#define ADMIN_CHECK ADMIN_LEVEL_H 
 
static const COLOR[] = "^x04" //green 
/*----------------------------------------*/ 
 
new maxplayers 
new gmsgSayText 
 
public plugin_init() { 
        register_plugin("Premium Check", "1.0", "OneEyed & V!p3r") 
        maxplayers = get_maxplayers() 
        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, "premium") != -1 ) || contain(said, "/premium") != -1 ) 
                set_task(0.1,"print_adminlist",id) 
        return PLUGIN_CONTINUE 
} 
 
public print_adminlist(user)  
{ 
        new adminnames[33][32] 
        new message[256] 
        new id, count, x, len 
         
        for(id = 1 ; id <= maxplayers ; id++) 
                if(is_user_connected(id)) 
                        if(get_user_flags(id) & ADMIN_LEVEL_H) 
                                get_user_name(id, adminnames[count++], 31) 
 
        len = format(message, 255, "%s Gracze Premium: ",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, "Brak Graczy Premium.") 
                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() 
}


--------------------------------------
Pomogłem? Daj + w prawym dolnym rogu.





Również z jednym lub większą ilością słów kluczowych: CoD Stary

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych