PDA

View Full Version : [REZOLVAT] Salut !



bLLue
29-06-2013, 09:39 AM
As dori si eu plugin /admin /admins /who sa apara intr-un motd Grad nume pe mine ma intereseaza literele sa fie facute calumea va multumesc !

Power.
29-06-2013, 10:03 AM
Da-mi gradele si accesle, daca nu vrei sa le dai atunci modifica-le in urmatorul cod:


#include < amxmodx >
#include < amxmisc >

#pragma semicolon 1


static const PLUGIN[ ] = "Who Admin Motd";
static const VERSION[ ] = "1.0";
static const AUTHOR[ ] = "P. of Pw.";

#define CharsMax(%1) sizeof(%1)-1

#define GROUPS_NAME 7
#define GROUPS_ACCESS 7

#define RRR 255
#define GGG 255
#define BBB 255

new GroupNames[ GROUPS_NAME ][ ] =
{
"-=== DetinatoR + FTP ===-",
"-=== Co-Detinator ===-",
"-=== Co-Owner + VIP ===-",
"-=== God + VIP ===-",
"-=== Moderator + VIP ===-",
"-=== Administrator + VIP ===-",
"-=== SloT ===-"
};

new GroupFlags[ GROUPS_ACCESS ][ ] =
{
"abcdefghijklmnopqrstu",
"bcdefghijklmnopqrstu",
"bcdefghijklmnopqrst",
"bcdefghijlmnopqrst",
"bcdefgijmnopt",
"bceijt",
"b"
};

new GroupFlagsValue[ GROUPS_ACCESS ];

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );

register_clcmd( "say /admins", "cmdWhoAdmin" );
register_clcmd( "say /admin", "cmdWhoAdmin" );
register_clcmd( "say /who", "cmdWhoAdmin" );

for( new p_of_pw = 0 ; p_of_pw < GROUPS_NAME ; p_of_pw++ )
GroupFlagsValue[ p_of_pw ] = read_flags( GroupFlags[ p_of_pw ] );


}

public cmdWhoAdmin( id )
{
new sPlayers[32], iNum, iPlayer;
new sName[32], sBuffer[1024];
new iLen;

iLen = formatex(sBuffer, CharsMax(sBuffer) , "<body bgcolor=#000000><font color=#7b68ee><pre>");

get_players(sPlayers, iNum, "ch");

for(new p_of_pw = 0; p_of_pw < GROUPS_NAME ; p_of_pw++)
{
iLen += formatex(sBuffer[iLen], CharsMax (sBuffer) - iLen, "<center><h5><font color=^"red^">%s^n</font></h5></center>", GroupNames[p_of_pw]);

for(new a = 0; a < iNum ; a++)
{
iPlayer = sPlayers[a];

if(get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
{
get_user_name(iPlayer, sName, sizeof sName - 1);
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center>%s^n</center>", sName);
}
}
}
show_motd(id, sBuffer, "Admins Online");

return 0;

}

bLLue
29-06-2013, 10:15 AM
Detinator + FTP
Owner
Co-owner
Best God
God
Moderator
Helper
Super Slot
Slot

Literele fale tu ca eu la asta nu ma pricep incat de la Best Good sa aiba acces la cvar si autobalace. MS

Power.
29-06-2013, 11:04 AM
Done!

Obeservatie! Autoteambalance este o comanda ce poate fi folosita cu cvar, deci e 2 in 1. Ex. amx_cvar sv_autoteambalance "1/0"


#include < amxmodx >
#include < amxmisc >

#pragma semicolon 1


static const PLUGIN[ ] = "Who Admin Motd";
static const VERSION[ ] = "1.0";
static const AUTHOR[ ] = "P. of Pw.";

#define CharsMax(%1) sizeof(%1)-1

#define GROUPS_NAME 9
#define GROUPS_ACCESS 9

#define RRR 255
#define GGG 255
#define BBB 255

new GroupNames[ GROUPS_NAME ][ ] =
{
"-=== DetinatoR + FTP ===-",
"-=== Owner ===-",
"-=== Co-owner ===-",
"-=== Best God ===-",
"-=== God ===-",
"-=== Moderator ===-",
"-=== Helper ===-",
"-=== Super Slot ===-",
"===- Slot ===-"
};

new GroupFlags[ GROUPS_ACCESS ][ ] =
{
"abcdefghijklmnopqrstu",
"abcdefghijklmnopqrst",
"abcdefghijklmnopqrst",
"abcdefghijlmnopqrst",
"bcdefhijlmnopqrst",
"bcdefijmnopt",
"bceijt",
"ab",
"b"
};

new GroupFlagsValue[ GROUPS_ACCESS ];

public plugin_init( )
{
register_plugin( PLUGIN, VERSION, AUTHOR );

register_clcmd( "say /admins", "cmdWhoAdmin" );
register_clcmd( "say /admin", "cmdWhoAdmin" );
register_clcmd( "say /who", "cmdWhoAdmin" );

for( new p_of_pw = 0 ; p_of_pw < GROUPS_NAME ; p_of_pw++ )
GroupFlagsValue[ p_of_pw ] = read_flags( GroupFlags[ p_of_pw ] );


}

public cmdWhoAdmin( id )
{
new sPlayers[32], iNum, iPlayer;
new sName[32], sBuffer[1024];
new iLen;

iLen = formatex(sBuffer, CharsMax(sBuffer) , "<body bgcolor=#000000><font color=#7b68ee><pre>");

get_players(sPlayers, iNum, "ch");

for(new p_of_pw = 0; p_of_pw < GROUPS_NAME ; p_of_pw++)
{
iLen += formatex(sBuffer[iLen], CharsMax (sBuffer) - iLen, "<center><h5><font color=^"red^">%s^n</font></h5></center>", GroupNames[p_of_pw]);

for(new a = 0; a < iNum ; a++)
{
iPlayer = sPlayers[a];

if(get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
{
get_user_name(iPlayer, sName, sizeof sName - 1);
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen, "<center>%s^n</center>", sName);
}
}
}
show_motd(id, sBuffer, "Admins Online");

return 0;

}


Aceese ( ca sa le stii in viitor):


ADMIN_ALL //toti
ADMIN_IMMUNITY //Flag "a", imunitate
ADMIN_RESERVATION //Flag "b", nume rezervat (slot)
ADMIN_KICK //Flag "c", kick
ADMIN_BAN //Flag "d", ban
ADMIN_SLAY //Flag "e", slay
ADMIN_MAP //Flag "f", map change
ADMIN_CVAR //Flag "g", acces cvar
ADMIN_CFG //Flag "h", acces la executarea configurilor (server.cfg, banip.cfg etc. )
ADMIN_CHAT //Flag "i", chat
ADMIN_VOTE //Flag "j", vote
ADMIN_PASSWORD //Flag "k", sv_password
ADMIN_RCON //Flag "l", acces rcon
ADMIN_LEVEL_A //Flag "m", custom
ADMIN_LEVEL_B //Flag "n", custom
ADMIN_LEVEL_C //Flag "o", custom
ADMIN_LEVEL_D //Flag "p", custom
ADMIN_LEVEL_E //Flag "q", custom
ADMIN_LEVEL_F //Flag "r", custom
ADMIN_LEVEL_G //Flag "s", custom
ADMIN_LEVEL_H //Flag "t", custom
ADMIN_MENU //Flag "u", acces la meniuri
ADMIN_ADMIN //Flag "y", admin normal
ADMIN_USER //Flag "z", jucator normal

Tiger
30-06-2013, 05:11 PM
Si ceva mai frumos:

Link screenshot: <b>You have to register to ba able to see this link</b>

Download sursa: Click aici! (<b>You have to register to ba able to see this link</b>)

PS: Pentru fiecare grad puteti seta o alta culoare. De asemenea, puteti seta si background-ul si imaginea simplu. Nu uitati faptul ca motd-ul ("intern") accepta maxim 1536 de caractere, asa ca va trebui sa fiti lacomi cu caracterele in plus :P (motivul pentru care nu prefer admin checker prin motd si prefer prin meniu).

Daca aveti probleme cu pluginul postati aici.