This returns Server Unknown Command, But still executes?
#4

Don't have it in the script, I thought it might be because I didn't put the !(not) infront of the other co-ordinates, so I'm testing, although I have an issue with this:

pawn Код:
CMD:housestore(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");

    new cashamount, string[128],function[16], sum;
    new houseid = GetPlayerHouseID(playerid);
    if(sscanf(params, "s[16]",function)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /housestore [function] - Functions: Money, Weed, Cocaine.");

    else if(strcmp(function, "money", true))
    {
        if(sscanf(params, "s[16]d",params, cashamount)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /housestore [money] [amount]");
        if(cashamount < 1 || cashamount > 500000) return SendClientMessage(playerid, COLOUR_GREY, "The amount must be between $0 and $500,000.");
        if(cashamount > PlayerMoney[playerid]) return SendClientMessage(playerid, COLOUR_GREY, "You do not have this much to store.");
        if(HouseOwned[playerid] == houseid)
        {
            printf("House Owned: %d", HouseOwned[playerid]);
            sum = HouseMoney[houseid] += cashamount;
            HouseSQLID[houseid] = MySQL_GetValue(HouseSQLID[houseid], "id", "houses");
            MySQL_SetInteger(HouseSQLID[houseid], "HouseMoney", sum, "houses");
            GivePlayerMoney(playerid, -cashamount);
            printf("Cash amount %d", cashamount);
            format(string, sizeof(string), "You have stored $%d in your house.", cashamount);
            SendClientMessage(playerid, COLOUR_ORANGE, string);
        }

    }
    return 1;
}
The issue is, that when I type /housestore money it doesnt return the sscanf for that strcmp.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)