Admin chat sending blank messages
#1

Hello, I have never come across this before but when I do /a message on my server it just sends a blank message. It never used to do it.

Here's my command.
pawn Код:
CMD:a(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new achat[128], string[128];
        if(sscanf(params, "s[128]", achat)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [message]");

        switch(PlayerInfo[playerid][pAdmin])
        {
            case 1: format(string, sizeof(string), "{009DFF}Trial Mod %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 2: format(string, sizeof(string), "{009DFF}Moderator %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 3: format(string, sizeof(string), "{009DFF}Admin %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 4: format(string, sizeof(string), "{009DFF}Lead Admin %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 5: format(string, sizeof(string), "{009DFF}Owner %s: {FFFFFF}%s", PlayerName(playerid), achat);
        }
        SendAdminMessage(COLOR_WHITE, string);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR: You don't seem to be an admin!");
    }
    return 1;
}
Reply
#2

pawn Код:
string[128]
Increase? As you use additional string there.

Otherwise, show us SendAdminMessage/
Reply
#3

Just tried string[256] and still nothing.

Here's my SendAdminMessage.

pawn Код:
stock SendAdminMessage(color, text[])
{
    foreach(Player, i)
    {
        if(PlayerInfo[i][pAdmin] >= 1 || IsPlayerAdmin(i))
        {
            SendClientMessage(i, color, text);
        }
    }
    return 0;
}
Reply
#4

pawn Код:
CMD:a(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new achat[256];
        if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [message]");

        switch(PlayerInfo[playerid][pAdmin])
        {
            case 1: format(achat, sizeof(achat), "{009DFF}Trial Mod %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 2: format(achat, sizeof(achat), "{009DFF}Moderator %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 3: format(achat, sizeof(achat), "{009DFF}Admin %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 4: format(achat, sizeof(achat), "{009DFF}Lead Admin %s: {FFFFFF}%s", PlayerName(playerid), achat);
            case 5: format(achat, sizeof(achat), "{009DFF}Owner %s: {FFFFFF}%s", PlayerName(playerid), achat);
        }
        SendAdminMessage(COLOR_WHITE, achat);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR: You don't seem to be an admin!");
    }
    return 1;
}
Reply
#5

pawn Код:
CMD:a(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new string[128];
        if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [message]");

        switch(PlayerInfo[playerid][pAdmin])
        {
            case 1: format(string, sizeof(string), "{009DFF}Trial Mod %s: {FFFFFF}%s", PlayerName(playerid), params);
            case 2: format(string, sizeof(string), "{009DFF}Moderator %s: {FFFFFF}%s", PlayerName(playerid), params);
            case 3: format(string, sizeof(string), "{009DFF}Admin %s: {FFFFFF}%s", PlayerName(playerid), params);
            case 4: format(string, sizeof(string), "{009DFF}Lead Admin %s: {FFFFFF}%s", PlayerName(playerid), params);
            case 5: format(string, sizeof(string), "{009DFF}Owner %s: {FFFFFF}%s", PlayerName(playerid), params);
        }
        SendAdminMessage(COLOR_WHITE, string);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "ERROR: You don't seem to be an admin!");
    }
    return 1;
}
EDIT: nvm
Reply
#6

For a very weird reason it still isn't working.
Reply
#7

Quote:
Originally Posted by -Luis
Посмотреть сообщение
For a very weird reason it still isn't working.
Did you try using my code?
Reply
#8

Try this:

pawn Код:
CMD:a(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] <= 0)return SendClientMessage(playerid, COLOR_RED, "ERROR: You don't seem to be an admin!");
    new achat[128], string[128];
    if(sscanf(params, "s", achat)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /a [message]");
    switch(PlayerInfo[playerid][pAdmin])
    {
        case 1: format(string, sizeof(string), "{009DFF}Trial Mod %s: {FFFFFF}%s", PlayerName(playerid), achat);
        case 2: format(string, sizeof(string), "{009DFF}Moderator %s: {FFFFFF}%s", PlayerName(playerid), achat);
        case 3: format(string, sizeof(string), "{009DFF}Admin %s: {FFFFFF}%s", PlayerName(playerid), achat);
        case 4: format(string, sizeof(string), "{009DFF}Lead Admin %s: {FFFFFF}%s", PlayerName(playerid), achat);
        case 5: format(string, sizeof(string), "{009DFF}Owner %s: {FFFFFF}%s", PlayerName(playerid), achat);
    }
    SendAdminMessage(COLOR_WHITE, string);
    return 1;
}
Reply
#9

I really am getting confused here, none of the codes are working all's they're doing is sending a blank line.
Reply
#10

Debug your params and the chat.
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)