SSCANF error, command won't work correctly.
#4

You can't use the "S" parameter in the middle of the function ( SSCANF Language ).. and you don't even use it..
Try this:
pawn Код:
command(give, playerid, params[])
{
    new id, section[12], amount, string[128];
    if(unformat(params, "us[12]I(0)", id, section, amount))
    else if(strmatch(section, "mats"))
    {
        if(amount == 0)return SendClientMessage(playerid, GREY, "Usage: /give [player id or name] mats [amount]");
        if(Player[playerid][Materials] >= amount)
        {
            Player[playerid][Materials] -= amount;
            Player[id][Materials] += amount;
            format(string, sizeof(string), "%s has given you %d materials.", MaskName(playerid), amount);
            SendClientMessage(id, SHOUT, string);
            format(string, sizeof(string), "You have given %d materials to %s.", amount, MaskName(id));
            SendClientMessage(playerid, SHOUT, string);
            format(string, sizeof(string), "* %s hands over some materials to %s. *", MaskName(playerid), MaskName(id));
            CloseMessage(playerid, ACTION, string);
        }
        else return SendClientMessage(playerid, GREY, "You don't have that many materials.");
    }
    return 1;
}
Reply


Messages In This Thread
SSCANF error, command won't work correctly. - by iGetty - 20.01.2013, 18:43
Re: SSCANF error, command won't work correctly. - by Red_Dragon. - 20.01.2013, 19:06
Re: SSCANF error, command won't work correctly. - by iGetty - 20.01.2013, 19:13
Re: SSCANF error, command won't work correctly. - by Roach_ - 20.01.2013, 20:04

Forum Jump:


Users browsing this thread: 2 Guest(s)