SA-MP Forums Archive
Admin Chat - 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 Chat (/showthread.php?tid=500758)



Admin Chat - Mriss - 15.03.2014

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


Re: Admin Chat - DarkLored - 15.03.2014

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



Re: Admin Chat - Mriss - 15.03.2014

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


Re: Admin Chat - DarkLored - 15.03.2014

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


Re: Admin Chat - DerickClark - 15.03.2014

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



Re: Admin Chat - DarkLored - 15.03.2014

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 ...


Re: Admin Chat - DerickClark - 15.03.2014

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....