SA-MP Mobile

SA-MP Scripting and Plugins => Scripting Help => Help Archive => Topic started by: SA:MP on May 05, 2023, 08:51 AM

Title: Help me, please /a chat
Post by: SA:MP on May 05, 2023, 08:51 AM
Help me, please /a chat

So, I'm trying to make an admin chat, basically admins can speak with eachother using the command /a [text]

But, I got this command:


pawn Code:

CMD:a(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME], result[128], string[128];
    if(!(PlayerInfo[playerid][pAdmin] >= 1)) return SCM(playerid, COLOR_GREY,"You are not authorized to use this command");
    if(sscanf(params,"s[128]", result)) return SCM(playerid, COLOR_GOLD,"USAGE: /a [chat]");
    else
    {
        format(string, sizeof(string),"*%d Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
        SendAdminMessage(COLOR_GOLD, string);
    }
    return 1;
}

Every time I type for example: /a hello, or anything, I'm getting always this message: "USAGE: /a [chat]", any help, please?

Source: Help me, please /a chat (https://sampforum.blast.hk/showthread.php?tid=278881)