Admin Message
#1

how do i make admin message?
it's something like if any admin login its saying
"(adminlevel) (adminname) Has Logged in"
my variable
Код:
    if (P_DATA[ playerid ][ P_Level ]
Reply
#2

Quote:
Originally Posted by PowerF
Посмотреть сообщение
how do i make admin message?
it's something like if any admin login its saying
"(adminlevel) (adminname) Has Logged in"
my variable
Код:
    if (P_DATA[ playerid ][ P_Level ]
simple.
just after your login mechanism, something like:
pawn Код:
if(P_DATA[playerid][P_Level])
{
    new pn[MAX_PLAYER_NAME],s[52];//you may increase s if your admin level results in more than just 2 digits
    GetPlayerName(playerid,pn,sizeof pn);
    format(s,sizeof s,"LvL %d Admin %s has logged in!",P_DATA[playerid][P_Level],pn);
    SendClientMessageToAll(-1,s);
}
Reply
#3

Quote:
Originally Posted by CutX
Посмотреть сообщение
simple.
just after your login mechanism, something like:
pawn Код:
if(P_DATA[playerid][P_Level])
{
    new pn[MAX_PLAYER_NAME],s[52];//you may increase s if your admin level results in more than just 2 digits
    GetPlayerName(playerid,pn,sizeof pn);
    format(s,sizeof s,"LvL %d Admin %s has logged in!",P_DATA[playerid][P_Level],pn);
    SendClientMessageToAll(-1,s);
}
can i change Name of Level?
example:
"LvL 5 Admin Power has Logged in!" to "Server Owner Power has logged in"
Reply
#4

Quote:
Originally Posted by PowerF
Посмотреть сообщение
can i change Name of Level?
example:
"LvL 5 Admin Power has Logged in!" to "Server Owner Power has logged in"
sure, just switch'n through:
pawn Код:
if(P_DATA[playerid][P_Level])
{
    new pn[MAX_PLAYER_NAME],s[64],lvl[13];//adjust the sizes to your needs!
    GetPlayerName(playerid,pn,sizeof pn);
    switch(P_DATA[playerid][P_Level])
    {
        case 1: lvl = "something";
        case 2: lvl = "something";
        case 3: lvl = "something";
        case 4: lvl = "something";
        case 5: lvl = "Server Owner";
    }
    format(s,sizeof s,"LvL %s Admin %s has logged in!",lvl,pn);
    SendClientMessageToAll(-1,s);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)