Admin Chat
#1

Okay, So I need help with the actual command of the Admin Chat, but ive already got the stock. heres the stock
pawn Код:
stock SendMessageToAdmins(fromid, colour, msg[])
{
    new pName[MAX_PLAYER_NAME], string[128];
    GetPlayerName(fromid, pName, MAX_PLAYER_NAME);
    format(string, sizeof(string), "%s: %s", pName, msg);
    for(new i; i < GetMaxPlayers(); i++)
    {
        if(pInfo[playerid][pAdmin] < 1)
        {
            SendClientMessage(i, colour, string);
        }
    }
}
So how do i do the CMD:a(playerid,params[])


I need it in ZCMD btw
Reply
#2

here you go its pretty easy tho

pawn Код:
CMD:a(playerid,params[])
{
    new string[128];
    if(pInfo[playerid][Adminlevel] >= 1)
    {
       if(!strlen(params))
       {
          SendClientMessage(playerid,COLOR_ERROR,"USAGE: /a (Message)");
          return 1;
       }
       format(string,sizeof(string),"[ADMIN CHAT] %s(%d): %s",GetName(playerid),playerid,params);
       SendMessageToAdmins(string);
    }
    else return SendClientMessage(playerid,COLOR_ERROR,"Unknown command type /commands or /gcommands to view your commands");
    return 1;
}
Reply
#3

Damn, My Stock aint working right... Could you Create a stock+the command in zcmd?
Reply
#4

Here
stock SendMessageToAdmins(text[])
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(pInfo[i][Adminlevel] != 0)
{
SendClientMessage(i, COLOR_LIME, text);
}
}
}
Reply
#5

pawn Код:
SendMessageToAdmins(playerid, -1, "/COMMANDHERE");// Put it in a command and rename.
Reply
#6

Quote:
Originally Posted by DerickClark
Посмотреть сообщение
pawn Код:
SendMessageToAdmins(playerid, -1, "/COMMANDHERE");// Put it in a command and rename.
Are you trying to troll him or something this is completely not the code that he requested.

and its already solved thats why he dosent reply cause i gave him the code he needed ...
Reply
#7

Quote:
Originally Posted by DarkLored
Посмотреть сообщение
Are you trying to troll him or something this is completely not the code that he requested.

and its already solved thats why he dosent reply cause i gave him the code he needed ...
._.
it just a example....
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)