Message isn't showing
#1

Well...I edited the /newb command to be like this:
pawn Код:
CMD:newb(playerid, params[])
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }
    if(PlayerInfo[playerid][pTut] == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
        return 1;
    }
    if ((nonewbie) && PlayerInfo[playerid][pAdmin] < 2)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an administrator!");
        return 1;
    }
    if(PlayerInfo[playerid][pNMute] == 1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the newbie chat channel.");
        return 1;
    }
    new string[128];
    if(NewbieTimer[playerid] > 0)
    {
        format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
        SendClientMessageEx(playerid, COLOR_GREY, string);
        return 1;
    }
    if(gNewbie[playerid]==1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
        return 1;
    }

    if(isnull(params)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /newb [message]");

    if(IsHelper(playerid) || IsAdmin(playerid))
    {
        new toid, message[128];
        if(sscanf(params, "is", toid, message)) return Syntax(playerid, "newb", "[playerid] [message]");
        if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
       
        if(PlayerInfo[playerid][pAdmin] >= 1)
        {
        format(STRING, "** Admin %s: %s **", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(STRING, " Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE, string);
        }
        if(PlayerInfo[playerid][pHelper] == 1)
        {
        format(STRING, "** Helper %s [%d]: %s **", GetPlayerNameEx(playerid), playerid, message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(string, sizeof(string), " Helper %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE, string);
        }
        if(PlayerInfo[playerid][pHelper] == 2)
        {
        format(STRING, "** Advisor %s [%d]: %s **", GetPlayerNameEx(playerid), playerid, message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(string, sizeof(string), " Advisor %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE, string);
        }
        if(PlayerInfo[playerid][pHelper] == 3)
        {
        format(STRING, "** Senior Advisor %s : %s **", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(string, sizeof(string), " Senior Advisor %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE, string);
        }
        if(PlayerInfo[playerid][pHelper] == 4)
        {
        format(STRING, "** Chief Advisor %s : %s **", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(string, sizeof(string), " Chief Advisor %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE, string);
        }
        if(PlayerInfo[playerid][pHelper] == 5)
        {
        format(STRING, "** Senior Chief Advisor %s: %s **", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(string, sizeof(string), " Senior C. Advisor %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE, string);
        }
    }
    else
    {
    new message[256];
    //if(sscanf(params, "s", message)) return Syntax(playerid, "newb", "[message]");
    format(STRING, "** Newbie %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
    SendHelperMessage(COLOR_NEWBIE,string);
    format(STRING, "Your question, has been sent to the online moderators.");
    SendClientMessageEx(playerid, COLOR_NEWBIE, string);
    }
    if(PlayerInfo[playerid][pHelper]<1&&PlayerInfo[playerid][pAdmin] < 1)
    {
        NewbieTimer[playerid] = 30;
    }
    return 1;
}
BUt it doesn't show the message from newbies
pawn Код:
format(STRING, "** Newbie %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
    SendHelperMessage(COLOR_NEWBIE,string);
Can someone help me out with it?
Reply
#2

show this stock !! ( SendHelperMessage(COLOR_NEWBIE,string); )
Reply
#3

I can't see you defining string sizes anywhere.
Reply
#4

if u need technical help in these
Quote:

Add me On skype: ahbasem

Photo:redspeed servers
Reply
#5

Quote:
Originally Posted by DaTa[X]
Посмотреть сообщение
show this stock !! ( SendHelperMessage(COLOR_NEWBIE,string); )
Here it is:
pawn Код:
public SendHelperMessage(color, string[])
{
    foreach(Player, i)
    {
        if(PlayerInfo[i][pHelper] >= 1 || PlayerInfo[i][pAdmin] >= 1)
        {
            SendClientMessageEx(i, color, string);
            }
     }
}
Reply
#6

Ofcourse it doesn't work if you want it to work uncomment your if(sscanf(

Or do the following.
pawn Код:
// either this
    new message[256];
    if(sscanf(params, "s[256]", message)) return Syntax(playerid, "newb", "[message]");
    format(STRING, "** Newbie %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
    SendHelperMessage(COLOR_NEWBIE,string);
    format(STRING, "Your question, has been sent to the online moderators.");
    SendClientMessageEx(playerid, COLOR_NEWBIE, string);
    // Or this.
    //if(sscanf(params, "s", message)) return Syntax(playerid, "newb", "[message]");
    format(STRING, "** Newbie %s [%d]: %s", GetPlayerNameEx(playerid), playerid,params);
    SendHelperMessage(COLOR_NEWBIE,string);
    format(STRING, "Your question, has been sent to the online moderators.");
    SendClientMessageEx(playerid, COLOR_NEWBIE, string);
The reason it doesn't work because you're only typing the variable MESSAGE and variable message isn't defined as params, so either you turn back your sscanf back or show your (params).
I think both codes will work try one of them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)