SA-MP Forums Archive
Message isn't showing - 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: Message isn't showing (/showthread.php?tid=528233)



Message isn't showing - Drago987 - 27.07.2014

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?


Re: Message isn't showing - DaTa[X] - 27.07.2014

show this stock !! ( SendHelperMessage(COLOR_NEWBIE,string); )


Re: Message isn't showing - Sojo12 - 27.07.2014

I can't see you defining string sizes anywhere.


Re: Message isn't showing - Marcoes - 27.07.2014

if u need technical help in these
Quote:

Add me On skype: ahbasem

Photo:redspeed servers


Re: Message isn't showing - Drago987 - 28.07.2014

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



Re: Message isn't showing - Beckett - 28.07.2014

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.