SA-MP Forums Archive
Admin Message - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Admin Message (/showthread.php?tid=553312)



Admin Message - PowerF - 29.12.2014

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 ]



AW: Admin Message - CutX - 29.12.2014

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);
}



Re: AW: Admin Message - PowerF - 29.12.2014

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"


AW: Re: AW: Admin Message - CutX - 29.12.2014

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);
}