Undefined, "result"
#2

The result variable is supposed to be the message?

Use sscanf and ZCMD instead, they're faster.

zcmd.inc
sscanf

pawn Код:
CMD:gov(playerid, params[])
{
    if(IsPlayerConnected(playerid))
    {
        if(PlayerInfo[playerid][pJob] == 77 || IsInFaction(playerid, "LSPD") || IsInFaction(playerid, "GOV") || IsInFaction(playerid, "LSFD") || IsInFaction(playerid, "NG") || IsInFaction(playerid, "FBI") || IsInFaction(playerid, "SASD") || IsInFaction(playerid, "CIA"))
        {
            new result;
            if(sscanf(params, "s", result)) return SendClientMessage(playerid, -1, "USAGE: /gov [message]");
            format(string, sizeof(string),"|___________________________________Government Announcement___________________________________|");
            SendClientMessage(giveplayerid, COLOR_ORANGE, string);
            format(string, sizeof(string), "[%s: %s %s] %s",GetPlayerFactionName(playerid),GetPlayerRank(playerid),GetPlayerNameEx(playerid),result);
            SendClientMessage(giveplayerid, COLOR_WHITE, string);
            format(string, sizeof(string),"|___________________________________Government Announcement___________________________________|");
            SendClientMessage(giveplayerid, COLOR_ORANGE, string);
        }
    }
    else SendClientMessage(playerid, COLOR_GRAD1, "You can't use this command!");
    return 1;
}
I'm not very experienced with the strcmp way of making commands.
Reply


Messages In This Thread
Undefined, "result" - by Mr.1337 - 03.02.2013, 18:11
Re: Undefined, "result" - by SKAzini - 03.02.2013, 18:21
Re: Undefined, "result" - by Mr.1337 - 03.02.2013, 18:30
Re: Undefined, "result" - by Mr.1337 - 03.02.2013, 18:45
Re: Undefined, "result" - by SKAzini - 03.02.2013, 18:47
Re: Undefined, "result" - by Mr.1337 - 03.02.2013, 18:50
Re: Undefined, "result" - by SKAzini - 04.02.2013, 05:22
Re: Undefined, "result" - by denNorske - 04.02.2013, 08:02
Re: Undefined, "result" - by spedico - 04.02.2013, 08:07
Re: Undefined, "result" - by denNorske - 04.02.2013, 08:17

Forum Jump:


Users browsing this thread: 1 Guest(s)