SA-MP Forums Archive
/b command - 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: /b command (/showthread.php?tid=606514)



/b command - ArianGubetini - 05.05.2016

Hello there.I want to ask if you guys can tell me how to modify this command so when an admin on duty use /b his text will show with a different color from normal players.
EX, normal player /b "white text"
admin on duty /b "red text"

Here is my command:

Код HTML:
CMD:b(playerid, params[])
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }
    if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /b [local ooc chat]");
    new string[128];
    format(string, sizeof(string), "%s: (( %s ))", GetPlayerNameEx(playerid), params);
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
 
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] > 1 && BigEar[i] == 2)
        {
            new szAntiprivacy[128];
            format(szAntiprivacy, sizeof(szAntiprivacy), "(BE) %s: %s", GetPlayerNameEx(playerid), params);
            SendClientMessageEx(i, COLOR_FADE1, szAntiprivacy);
        }
    }
    return 1;
}



Re: /b command - Sew_Sumi - 05.05.2016

If you need a scripter, there's a thread for that.

All I'm seeing is a godfather edit command being put up and you wanting it to be made for you.

Код:
new string[128];
    format(string, sizeof(string), "%s: (( %s ))", GetPlayerNameEx(playerid), params);
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
This is where the change needs to be so you can look at it more.

You need an if statement in there, based on the admin level.

You could go for real improvement by simply changing the player name rather than the entire line, by using embedded colors.

The wiki has a lot of information.