Help with acronyms scripting
#5

The new command:
pawn Код:
dcmd_admsg(playerid,params[])
{
    if(!strlen(params)) return SendClientMessage(playerid,COLOR_ERROR,"USAGE: /admsg (Message)");
    if(!IsSpawned[playerid]) return SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
    new string[128];
    format(string, sizeof(string), "4[ADMIN CHAT] %s(%d): %s", PlayerName(playerid), playerid, params);
    IRC_GroupSay(gGroupAdminID, IRC_ADMINCHANNEL, string);
    format(string, sizeof(string), "[ADMIN CHAT] %s(%d): %s", PlayerName(playerid), playerid, params);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        if(!AdminLevel[i]) continue;
        SendClientMessage(i,COLOR_ADMIN,string);
    }
    return 1;
}
OnPlayerText:
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        if(AdminLevel[playerid])
        {
            if(IsSpawned[playerid])
            {
                new string[128];
                format(string, sizeof(string), "4[ADMIN CHAT] %s(%d): %s", PlayerName(playerid), playerid, text[1]);
                IRC_GroupSay(gGroupAdminID, IRC_ADMINCHANNEL, string);
                format(string, sizeof(string), "[ADMIN CHAT] %s(%d): %s", PlayerName(playerid), playerid, text[1]);
                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(!IsPlayerConnected(i)) continue;
                    if(!AdminLevel[i]) continue;
                    SendClientMessage(i, COLOR_ADMIN, string);
                }
                return 0;
            }
        }
    }
    //Rest of code...
I know there may be a way to return a command, I know that for ZCMD it would be cmd_admsg, but for dcmd it would be this?:
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '#')
    {
        if(AdminLevel[playerid])
        {
            dcmd_admsg(playerid, text[1]);
            return 0;
        }
    }
    //Rest of code...
}
Not sure what it is in dcmd though.

EDIT: @SyntaxQ and BenJackster, you should at least return 0 to stop admin chat from showing to all players. We can't predict his code.
Reply


Messages In This Thread
Help with acronyms scripting - by cleanboy - 03.06.2014, 11:55
Re: Help with acronyms scripting - by cleanboy - 03.06.2014, 12:12
Re: Help with acronyms scripting - by Parallex - 03.06.2014, 12:19
Re: Help with acronyms scripting - by SyntaxQ - 03.06.2014, 12:21
Re: Help with acronyms scripting - by Threshold - 03.06.2014, 12:22
Re: Help with acronyms scripting - by Rittik - 03.06.2014, 12:23
Re: Help with acronyms scripting - by cleanboy - 03.06.2014, 12:24
Re: Help with acronyms scripting - by Threshold - 03.06.2014, 12:54
Re: Help with acronyms scripting - by Threshold - 03.06.2014, 22:17

Forum Jump:


Users browsing this thread: 1 Guest(s)