[HELP]Admin name prefix
#1

I am gonna make a filterscript, that checks if player is admin and level > 5 , to prefix before the name , but withouth rename the player like that [Admin]Fsdas: Hello all! I dont know from where to start i maked the check script but cant continue with prefixing. If someone could help i will be grateful.
Reply
#2

As I understand you want to add the prefix to the player's name without changing the name?
pawn Код:
//Something like this would work:
public OnPlayerText(playerid, text[])
{
    if(Your admin check here)
    {
        new pName[MAX_PLAYER_NAME], String[128], Prefix[] = "[Admin]";
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "%s%s %s", Prefix, pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
    }
    return 1;
}

//Or more simple:
public OnPlayerText(playerid, text[])
{
    if(Your admin check here)
    {
        new pName[MAX_PLAYER_NAME], String[128];
        GetPlayerName(playerid, pName, 24);
        format(String, sizeof(String), "[Admin]%s %s", pName, text);
        SendClientMessageToAll(-1,String);
        return 0;
    }
    return 1;
}
Reply
#3

pawn Код:
if(PlayerInfo[playerid][pAdmin] > 5)
            {
new result[82]; //you may edite it
                format(string, sizeof(string), "[Admin]%s: %s", sendername, text);
   
            }
Reply
#4

@ Fj0rtizFredde
i changed it alittle bit and it worked! Tnx anyway! +Rep , BTW Can Lock
Reply
#5

can someone make this with command ? Like .. /Setprefix id prefix name ..
Reply
#6

Quote:
Originally Posted by d0nTtoucH
Посмотреть сообщение
can someone make this with command ? Like .. /Setprefix id prefix name ..
Something like this? If so then don't just copy and paste it as you will need to change some stuff, for example where I wrote "[ADMIN SYSTEM HERE]"

pawn Код:
CMD:makeadmin(playerid, params[])
{
    new targetid, level, string[128];
    [ADMIN SYSTEM HERE] && !IsPlayerAdmin(playerid)) return SendClientMessageEx(playerid, -1, "You are not authourized to use this command.");
    else if(sscanf(params, "ui", targetid, level)) return SendClientMessageEx(playerid, -1, "Usage: /makeadmin [playerid] [0-5]");
    else if(!IsPlayerConnectedEx(targetid) || !IsPlayerLogged(targetid)) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
    else if(level < 0 || level > 5) return SendClientMessageEx(playerid, -1, "You have enter an invalid administrator level.");
    PlayerInfo[targetid][pAdminLevel] = level;
    format(string, sizeof(string), "* You have been made a %s by %s %s.", GetAdminRank(targetid), GetAdminRank(playerid), GetPlayerNameEx(playerid));
    SendClientMessageEx(targetid-1, string);
    format(string, sizeof(string), "You have made %s a %s.", GetPlayerNameEx(targetid), GetAdminRank(targetid));
    SendClientMessageEx(playerid, -1, string);
    return 1;
}
REP if I helped please
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)