[HELP] Chat command.
#3

Quote:
Originally Posted by Rob_Maate
Посмотреть сообщение
pawn Код:
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(gPlayerLogged[playerid] == 0)
            {
                SendClientMessage(playerid, COLOR_GREY, "   You need to login first.");
                return 1;
            }
                        new sendername[64];
            sendername = name(playerid)
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/s)hout [Local IC]");
                return 1;
            }
            format(string, sizeof(string), "%s Shouts: %s!", sendername, result);
            ProxDetector(50.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
            printf("%s", string);
        }
        return 1;
    }
Try that
You just copied and pasted that from another script, i can tell this by the "gPlayerLogged" variable, as his script my not have this variable.
Reply


Messages In This Thread
[HELP] Chat command. - by BlackSA - 25.11.2011, 20:28
Re: [HELP] Chat command. - by Rob_Maate - 25.11.2011, 20:53
Re: [HELP] Chat command. - by Joshb93 - 25.11.2011, 21:06
Re: [HELP] Chat command. - by iNorton - 25.11.2011, 21:18
Re: [HELP] Chat command. - by Rob_Maate - 25.11.2011, 21:20
Re: [HELP] Chat command. - by BlackSA - 26.11.2011, 05:55

Forum Jump:


Users browsing this thread: 1 Guest(s)