/a Command
#1

For my Roleplay Server, When I type /a (Type in watever you want to say) I want it display a color Like this. /a (Name of the person) [Senior Admin] (Chat)..... I also want it to recognize what admin Rank you are so when you type in /a It doesn't show you As Senior admin when your actually Head or something like that.


Please help
Reply
#2

This thread has been created for a reason!
https://sampforum.blast.hk/showthread.php?tid=187229
Reply
#3

Can't find it.... Anyone else?
Reply
#4

You haven't to find anything.
The thread is called Script Request...
Reply
#5

Do I need to request it? Can't you post it here? I mean, I already made the thread
Reply
#6

pawn Код:
enum AdminData
{
    pAdmin,
}
new pData[ MAX_PLAYERS ][ AdminData ];

YCMD:a(playerid, o[], help)
{
    if(help) return SendClientMessage(playerid, -1,"With this command you can speak in admin chat");
    else
    {
        new name[MAX_PLAYER_NAME], string[128], arank[20];
        if(isnull(o)) return SendClientMessage(playerid, -1,"Syntax error: /a [text]");
        GetPlayerName(playerid, name, sizeof(name));
        if(pData[ playerid ][ pAdmin ] == 1)
        { arank = "Head Admin"; }
        else if(pData[ playerid ][ pAdmin ] == 2)
        { arank = "Senior Admin"; }
        else if(pData[ playerid ][ pAdmin ] == 3)
        { arank = "Admin"; }
        else { arank = "None"; }
        format(str,sizeof(str),"%s [{00FF22}%s{FFFFFF}]: %s", name, arank, o);
        SendAdminMessage(-1, string);
    }
    return 1;
}
stock SendAdminMessage(color, string[])
{
    foreach(Player, i)
    {
        if(pData[ i ][ pAdmin ] > 0)
        {
            SendClientMessage(i, color, string);
        }
    }
}
Reply
#7

You sure? It just comes up with UNKNOWN command D;
Reply
#8

Are you using another command processors besides y_commands?
Reply
#9

Quote:
Originally Posted by SAMPTUTORIALS
Посмотреть сообщение
You sure? It just comes up with UNKNOWN command D;
It uses Y_INI; assure that you have the include and that you put the command outside of OnPlayerCommandText callback.
Reply
#10

I suggest you look up some basic scripting tutorials from http://wiki.sa-mp.com

It's not an Easy thing for beginners to start with Admin Levels and all..
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)