invalid subscript (not an array or too many subscripts)
#2

In your code, all you're sending is just the NameOfPlayer, so all it will say is:

Quote:

Steve

And that's it, it won't say the text. I fixed that below.

pawn Код:
CMD:newbie(playerid, params[])
{
    if(Player[playerid][NMute] == 1) return SendErrorMessage(playerid, "You are unable to use /(n)ewbie, reason: muted");
    new text[200], string[250];
    if(sscanf(params, "s[200]", text)) return SendErrorMessage(playeid, "/(n)ewbie [text]");
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(Player[p][NToggled] != 1 && Player[p][NMute] != 1)
            {
                format(string, sizeof(string), "Newbie chat: %s: %s", NameOfPlayer[playerid], text); // make sure that your stock for NameOfPlayer has square brackets,
                SendClientMessage(i, Colour_Newbie_Chat, string);
            }
        }
        return 1;
    }
    return 1;
}
Can you show us the stock for NameOfPlayer? It should have square brackets "[playerid]" like it does in the format.
Reply


Messages In This Thread
invalid subscript (not an array or too many subscripts) - by ArkoUK - 19.10.2013, 07:45
Re: invalid subscript (not an array or too many subscripts) - by DanishHaq - 19.10.2013, 08:30
Re: invalid subscript (not an array or too many subscripts) - by ArkoUK - 19.10.2013, 08:39
Re: invalid subscript (not an array or too many subscripts) - by Patrick - 19.10.2013, 08:47
Re: invalid subscript (not an array or too many subscripts) - by ArkoUK - 19.10.2013, 08:52

Forum Jump:


Users browsing this thread: 1 Guest(s)