Need help a Simple chat not working.
#1

pawn Код:
CMD:n(playerid, params[])
{
    if(PlayerInfo[playerid][pNMuted] == 0)
    {
        new
            Message[128];
        if(sscanf(params, "z", Message))
        {
         SendClientMessage(playerid, ERROR, "SYNTAX: /n [message]");
        }
        else
        {
      if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                new
                    MsgStr[128];
                format(MsgStr, sizeof(MsgStr), "Admin %s: %s", GetName(playerid), Message);
                SendNewbieMessage(MsgStr);
            }
            else if(PlayerInfo[playerid][pHelper] == 1)
            {
                new
                    MsgStr[128];
                format(MsgStr, sizeof(MsgStr), "Helper %s: %s", GetName(playerid), Message);
                SendNewbieMessage(MsgStr);
            }
            else if(PlayerInfo[playerid][pHelper] == 2)
            {
                new
                    MsgStr[128];
                format(MsgStr, sizeof(MsgStr), "Mod Helper %s: %s", GetName(playerid), Message);
                SendNewbieMessage(MsgStr);
            }
            else if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
            {
                new
                    MsgStr[128];
                format(MsgStr, sizeof(MsgStr), "Newbie %s: %s", GetName(playerid), Message);
                SendNewbieMessage(MsgStr);

                PlayerInfo[playerid][pNMuted] = 1;
                SetTimerEx("NSpamTimer", 4000, false, "d", playerid);
            }
        }
    }
    else
    {
       
        SendClientMessage(playerid, ERROR, "You are muted from the newbie chat.");
    }
    return 1;
}
The problem is the chat is not working properly when there is admin online then only it worx but with a Problem.

When i type /n it dosent show Usage: /n [message]
it shows the message to all that Admin/Helper/Helper Mod %s:

PLZ HELP ME
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)